From 31e0561865674f8cd56e3ed8131393a732ffcbac Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Wed, 17 Jan 2007 04:54:55 +0000 Subject: Roman Kyrylych * dependency removal fixes and refactoring --- scripts/makepkg | 71 +++++++++++++++++++-------------------------------------- 1 file changed, 24 insertions(+), 47 deletions(-) diff --git a/scripts/makepkg b/scripts/makepkg index 778858ee..0401c48d 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -255,6 +255,27 @@ handledeps() { return $missingdeps } +# fix flyspray bug #5923 +removedeps() { + if [ "$RMDEPS" = "1" -a "$EUID" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then + msg "Removing installed dependencies..." + pacman3 $PACMAN_OPTS -R $makedeplist $deplist + # fixes bug #6215 + elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then + msg "Removing installed dependencies..." + if [ "$INFAKEROOT" = "1" ]; then + export FAKEROOTKEY2=$FAKEROOTKEY + unset $FAKEROOTKEY + fi + sudo pacman3 $PACMAN_OPTS -R $makedeplist $deplist + if [ "$INFAKEROOT" = "1" ]; then + export FAKEROOTKEY=$FAKEROOTKEY2 + unset $FAKEROOTKEY2 + fi + fi +} + + usage() { echo "makepkg version $myver" echo @@ -751,22 +772,7 @@ else if [ ${PIPESTATUS[0]} -gt 0 ]; then error "Build Failed. Aborting..." - # fix flyspray bug #5923 - if [ "$RMDEPS" = "1" -a "$EUID" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then - msg "Removing installed dependencies..." - pacman $PACMAN_OPTS -R $makedeplist $deplist - elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then - msg "Removing installed dependencies..." - if [ "$INFAKEROOT" = "1" ]; then - export FAKEROOTKEY2=$FAKEROOTKEY - unset $FAKEROOTKEY - fi - sudo pacman $PACMAN_OPTS -R $makedeplist $deplist - if [ "$INFAKEROOT" = "1" ]; then - export FAKEROOTKEY=$FAKEROOTKEY2 - unset $FAKEROOTKEY2 - fi - fi + removedeps exit 2 fi else @@ -776,22 +782,7 @@ else [ $set_e -eq 1 ] && set +e if [ $? -gt 0 ]; then error "Build Failed. Aborting..." - # fix flyspray bug #5923 - if [ "$RMDEPS" = "1" -a "$EUID" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then - msg "Removing installed dependencies..." - pacman $PACMAN_OPTS -R $makedeplist $deplist - elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then - msg "Removing installed dependencies..." - if [ "$INFAKEROOT" = "1" ]; then - export FAKEROOTKEY2=$FAKEROOTKEY - unset $FAKEROOTKEY - fi - sudo pacman $PACMAN_OPTS -R $makedeplist $deplist - if [ "$INFAKEROOT" = "1" ]; then - export FAKEROOTKEY=$FAKEROOTKEY2 - unset $FAKEROOTKEY2 - fi - fi + removedeps exit 2 fi fi @@ -932,21 +923,7 @@ if [ "$CLEANUP" = "1" ]; then rm -rf ${pkgname}-${pkgver}-${pkgrel}-${CARCH}.log* fi -if [ "$RMDEPS" = "1" -a "$EUID" = "0" -a "$INFAKEROOT" != "1" -a \( ! -z "$deplist" -o ! -z "$makedeplist" \) ]; then - msg "Removing installed dependencies..." - pacman $PACMAN_OPTS -R $makedeplist $deplist -elif [ "$RMDEPS" = "1" -a "$DEP_SUDO" = "1" ]; then - msg "Removing installed dependencies..." - if [ "$INFAKEROOT" = "1" ]; then - FAKEROOTKEY2=$FAKEROOTKEY - unset FAKEROOTKEY - fi - sudo pacman $PACMAN_OPTS -R $makedeplist $deplist - if [ "$INFAKEROOT" = "1" ]; then - export FAKEROOTKEY=$FAKEROOTKEY2 - unset FAKEROOTKEY2 - fi -fi +removedeps msg "Finished making: $pkgname ($(date))" -- cgit v1.2.3-70-g09d2