summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xscripts/makepkg71
1 files 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))"