[arch-projects] [ABS] [PATCH v3 6/7] vcs prototypes: consistent coding style
Sebastian Schwarz
seschwar at googlemail.com
Wed Nov 9 09:09:09 EST 2011
On 2011-11-08 at 21:56 -0800, Linus Arver wrote:
> Some vcs prototypes do
>
> cd repo && update
>
> while others do it like
>
> cd repo
> update
>
> to update an existing repo. It makes sense to have them all do it the
> first way (there's nothing wrong with it, and it has better form).
I agree with the consistency issue, but not with using the first
way. makepkg is executed with `/bin/bash -e`[1]. Whenever
a command returns a non zero exit status makepkg exits
immediately. See bash(1) or set(1p). Thus conditional checks
on single commands with && and || are seldomly required[2].
Even in the second case the "update" step is never reached.
I personally find the second form easier to read, as one does
not have to think about why the && was mixed in, and if this
makes sense.
[1]: http://projects.archlinux.org/pacman.git/commit/?id=b69edc1c3532816576198995675dd6ad53df74df
[2]: http://projects.archlinux.org/pacman.git/commit/?id=2710b256cc260db6a0805c83fb3fcf9e32aa3d86
More information about the arch-projects
mailing list