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

Nagy Gabor ngaba at bibl.u-szeged.hu
Wed Apr 2 13:49:38 EDT 2008


> 
>  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.")"
> +        return 0
>      fi
>  }
>  
> -- 
> 1.5.4.5
> 

Well, imho this whole method is ugly. We should somehow collect the installed
packages, because '-R provision' doesn't work. And trying to install
dependencies with stripped pkgver, I don't know... [Not talking about the rare
case of unwanted orphan removal by remove_deps]

Bye


----------------------------------------------------
SZTE Egyetemi Könyvtár - http://www.bibl.u-szeged.hu
This mail sent through IMP: http://horde.org/imp/





More information about the pacman-dev mailing list