nicer fix for .foo cleanables
authorRob Holland <tigger@gentoo.org>
Wed, 11 Feb 2004 16:08:29 +0000 (16:08 +0000)
committerRob Holland <tigger@gentoo.org>
Wed, 11 Feb 2004 16:08:29 +0000 (16:08 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@214 d1e1f19c-881f-0410-ab34-b69fee027534

modules/targets.py

index e8f9581a00f0f39129c20880efea8048e8f07943..a60742d5be9f03ef30ffc77aabcaad2e1cde5ee3 100644 (file)
@@ -1,6 +1,6 @@
 # Distributed under the GNU General Public License version 2
 # Copyright 2003-2004 Gentoo Technologies, Inc.
-# $Header: /var/cvsroot/gentoo/src/catalyst/modules/Attic/targets.py,v 1.79 2004/02/11 15:14:05 tigger Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/Attic/targets.py,v 1.80 2004/02/11 16:08:29 tigger Exp $
 
 import os,string,imp,types,shutil
 from catalyst_support import *
@@ -227,7 +227,7 @@ class generic_stage_target(generic_target):
        def clean(self):
                destpath=self.settings["chroot_path"]
                
-               cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*","/root/.*"]
+               cleanables=["/etc/resolv.conf","/var/tmp/*","/tmp/*","/root/*"]
                if self.settings["target"] not in ["livecd-stage2"]:
                        #we don't need to clean up a livecd-stage2
                        cleanables.append("/usr/portage")
@@ -235,9 +235,13 @@ class generic_stage_target(generic_target):
                        destpath+="/tmp/stage1root"
                        #this next stuff can eventually be integrated into the python and glibc ebuilds themselves (USE="build"):
                        cleanables.extend(["/usr/share/gettext","/usr/lib/python2.2/test","/usr/lib/python2.2/encodings","/usr/lib/python2.2/email","/usr/lib/python2.2/lib-tk","/usr/share/zoneinfo"])
+               # turn on dotglobs so dot directories go too
+               cmd("shopt -s dotglob")
                for x in cleanables: 
                        print "Cleaning chroot: "+x+"..."
                        cmd("rm -rf "+destpath+x,"Couldn't clean "+x)
+               # turn it off in case it breaks something
+               cmd("shopt -u dotglob")
                if self.settings["target"]=="livecd-stage2":
                        if self.settings.has_key("livecd/empty"):
                                if type(self.settings["livecd/empty"])==types.StringType: