From 776a45ce7cd1ce8ddeebf4ec66fbdaa610af55a0 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 2 Jan 2007 16:34:50 +0000 Subject: * James Rosten Makepkg dep removal on failure FS#5923 --- scripts/makepkg | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'scripts/makepkg') diff --git a/scripts/makepkg b/scripts/makepkg index e9c53d17..778858ee 100755 --- a/scripts/makepkg +++ b/scripts/makepkg @@ -751,6 +751,22 @@ 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 exit 2 fi else @@ -760,6 +776,22 @@ 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 exit 2 fi fi -- cgit v1.2.3-24-g4f1b