[pacman-dev] [PATCH 2/2] makepkg: printf exists
Allan McRae
allan at archlinux.org
Sun May 23 08:58:44 EDT 2010
On 23/05/10 21:20, Andres P wrote:
> Signed-off-by: Andres P<aepd87 at gmail.com>
> ---
>
> Without a function, this would look like:
> local fmt="= %s\n"
> [[ $license ]]&& printf "license $fmt" "${license[@]}"
> [[ $replaces ]]&& printf "replaces $fmt" "${replaces[@]}"
> [[ $groups ]]&& printf "group $fmt" "${groups[@]}"
> [[ $depends ]]&& printf "depend $fmt" "${depends[@]}"
> [[ $optdepend ]]&& printf "optdepend $fmt" "${optdepends[@]}"
> [[ $conflict ]]&& printf "conflict $fmt" "${conflicts[@]}"
> [[ $provides ]]&& printf "provides $fmt" "${provides[@]}"
> [[ $backup ]]&& printf "backup $fmt" "${backup[@]}"
I'd prefer this version. In fact, removing the $fmt stuff would be
better as it is only two characters longer and makes it a lot more readable.
Again... commit messages...
Allan
More information about the pacman-dev
mailing list