[pacman-dev] makepkg fix (FS #5923)

James Rosten seinfeld90 at gmail.com
Fri Dec 29 16:44:04 EST 2006


This is a fix for Flyspray bug #5923
http://bugs.archlinux.org/task/5923.

Patch is below.

~ Jamie / yankees26
-------------- next part --------------
Index: makepkg
===================================================================
RCS file: /home/cvs-pacman/pacman-lib/scripts/makepkg,v
retrieving revision 1.26
diff -u -r1.26 makepkg
--- makepkg	21 Dec 2006 20:50:24 -0000	1.26
+++ makepkg	29 Dec 2006 21:41:12 -0000
@@ -751,6 +751,22 @@
 
 		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
 			exit 2
 		fi
 	else
@@ -760,6 +776,23 @@
 		[ $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
+
 			exit 2
 		fi
 	fi


More information about the pacman-dev mailing list