[pacman-dev] [PATCH] makepkg: do not ignore errors from pacman
* check_deps is being run in a subshell, so exit 1 has no meaning. * Its return value was also being ignored by the enclosing funcion. * Local assignments *always* take precedence over subshell's $? Fixes FS#19840 Although this really ignored *all* errors from pacman except 127, not just illegal directives in pacman.conf. Signed-off-by: Andres P <aepd87@gmail.com> --- Let's not go crazy with them subshells. $ fn() { foo=$(false); echo $?; local bar=$(false); echo $?; } $ fn 1 0 scripts/makepkg.sh.in | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index b0215c8..41e6978 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -434,14 +434,15 @@ resolve_deps() { local R_DEPS_SATISFIED=0 local R_DEPS_MISSING=1 - local deplist="$(check_deps $*)" + local deplist + deplist="$(check_deps $*)" || return if [[ -z $deplist ]]; then return $R_DEPS_SATISFIED fi if handle_deps $deplist; then # check deps again to make sure they were resolved - deplist="$(check_deps $*)" + deplist="$(check_deps $*)" || return [[ -z $deplist ]] && return $R_DEPS_SATISFIED elif (( DEP_BIN )); then error "$(gettext "Failed to install all missing dependencies.")" -- 1.7.1
On 20/06/10 12:13, Andres P wrote:
* check_deps is being run in a subshell, so exit 1 has no meaning.
If a line of code has no meaning, remove it. Perhaps add a comment why there is not exit after the error. Otherwise the patch is fine. Allan
On Sat, Jun 19, 2010 at 11:33 PM, Allan McRae <allan@archlinux.org> wrote:
If a line of code has no meaning, remove it. Perhaps add a comment why there is not exit after the error.
I can't do that until I can diff against another one of my patches, 'makepkg: undeclared local variables', which was accepted [1]. The patch also touches check_deps(). Andres P [1] http://mailman.archlinux.org/pipermail/pacman-dev/2010-June/011166.html
participants (2)
-
Allan McRae
-
Andres P