[pacman-dev] [PATCH] No error in makepkg when removing deps fails

Dan McGee dpmcgee at gmail.com
Wed Apr 2 11:24:18 EDT 2008


On Wed, Apr 2, 2008 at 10:14 AM, Allan McRae <mcrae_allan at hotmail.com> wrote:
>
>   From 9beeed7c54d94a95c9e0bccb863e9b09ea18bd4f Mon Sep 17 00:00:00 2001
>  From: Allan McRae <mcrae_allan at hotmail.com>
>  Date: Thu, 3 Apr 2008 01:07:25 +1000
>  Subject: [PATCH] No error in makepkg when removing deps fails
>
>  Catches error from when pacman is unable to remove dependencies after
>  successfully building package and prints warning.  Fixes FS#10039.
>
>  Signed-off-by: Allan McRae <mcrae_allan at hotmail.com>
>  ---
>   scripts/makepkg.sh.in |   11 +++++++++--
>   1 files changed, 9 insertions(+), 2 deletions(-)
>
>  diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>  index 1eb3d3a..395d525 100644
>  --- a/scripts/makepkg.sh.in
>  +++ b/scripts/makepkg.sh.in
>  @@ -447,10 +447,17 @@ remove_deps() {
>      done
>
>      msg "Removing installed dependencies..."
>  +    local ret=0
>      if [ "$ASROOT" = "0" ]; then
>  -        sudo pacman $PACMAN_OPTS -Rns $deplist
>  +        sudo pacman $PACMAN_OPTS -Rns $deplist || ret=$?
>      else
>  -        pacman $PACMAN_OPTS -Rns $deplist
>  +        pacman $PACMAN_OPTS -Rns $deplist || ret=$?
>  +    fi
>  +
>  +    # Fixes FS#10039 - exit cleanly as package has built successfully
>  +    if [ $ret -ne 0 ]; then
>  +        warning "$(gettext "Failed to remove installed dependencies.")"

Maybe print what deps we failed to remove? Or is it obvious from the
pacman output? I think it would be helpful though so the user could
begin undertaking manual cleanup.

>  +        return 0
>      fi
>   }
>




More information about the pacman-dev mailing list