Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=pacman-g2.git;a=commitdiff;h=4e0a1281a7ed2c5792310945b5cd12f59b3f3ca6

commit 4e0a1281a7ed2c5792310945b5cd12f59b3f3ca6
Author: Miklos Vajna <vmik...@frugalware.org>
Date:   Fri Aug 27 13:35:02 2010 +0200

makepkg: -Cc now removes the whole chroot

Previously -C:
- cleaned up the home of the fst user
- removed extra packages
- -Cc was the same as -C

Now -Cc removes the chroot as well, provided that it has no active bind
mounts. The idea is that in case makepkg fails but produces no log,
syncpkgcd could automatically run makepkg -Cc.

diff --git a/scripts/makepkg b/scripts/makepkg
index 0d32429..74555f3 100755
--- a/scripts/makepkg
+++ b/scripts/makepkg
@@ -814,6 +814,14 @@ if [ $CLEANCACHE -ge 1 ]; then
do
umount $i
done
+               if [ "$CLEANUP" = "1" ]; then
+                       if [ -z "`grep $CHROOTDIR /proc/mounts`" ]; then
+                               msg "Removing the chroot."
+                               rm -rf $CHROOTDIR
+                       else
+                               error "Failed to umount some bind mounts, can't 
remove the chroot."
+                       fi
+               fi
exit 0
else
error "You must be root to clean the cache."
_______________________________________________
Frugalware-git mailing list
Frugalware-git@frugalware.org
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to