Fix leading whitespace in empty() so it's only executed if there's something to execu...
authorAndrew Gaffney <agaffney@gentoo.org>
Tue, 26 Feb 2008 03:11:14 +0000 (03:11 +0000)
committerAndrew Gaffney <agaffney@gentoo.org>
Tue, 26 Feb 2008 03:11:14 +0000 (03:11 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1326 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/generic_stage_target.py

index f7c92c44ff2edd2109a79220e054c4c9d0a0c8ad..2f889e17be25613880ab9e96fabffdd1254f2999 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,12 @@
 # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2
 # $Id: $
 
+  26 Feb 2008; Andrew Gaffney <agaffney@gentoo.org>
+  modules/generic_stage_target.py:
+  Fix leading whitespace in empty() so it's only executed if there's something
+  to execute it on. Thanks to Justin Bronder <jsbronder@gentoo.org> in bug
+  211410 for pointing this out
+
   21 Feb 2008; Andrew Gaffney <agaffney@gentoo.org>
   targets/support/rc-update.sh:
   Quote baselayout package atom
index c4e81d14b0b9ada6edb680cfe75917c92a86faaa..b6ee5409ae128e4b70cf734b8fbf6339d6af6d53 100644 (file)
@@ -1156,21 +1156,21 @@ class generic_stage_target(generic_target):
                                        self.settings[self.settings["spec_prefix"]+"/empty"]=\
                                                self.settings[self.settings["spec_prefix"]+\
                                                "/empty"].split()
-                       for x in self.settings[self.settings["spec_prefix"]+"/empty"]:
-                               myemp=self.settings["destpath"]+x
-                               if not os.path.isdir(myemp):
-                                       print x,"not a directory or does not exist, skipping 'empty' operation."
-                                       continue
-                               print "Emptying directory",x
-                               """ 
-                               stat the dir, delete the dir, recreate the dir and set
-                               the proper perms and ownership
-                               """
-                               mystat=os.stat(myemp)
-                               shutil.rmtree(myemp)
-                               os.makedirs(myemp,0755)
-                               os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
-                               os.chmod(myemp,mystat[ST_MODE])
+                               for x in self.settings[self.settings["spec_prefix"]+"/empty"]:
+                                       myemp=self.settings["destpath"]+x
+                                       if not os.path.isdir(myemp):
+                                               print x,"not a directory or does not exist, skipping 'empty' operation."
+                                               continue
+                                       print "Emptying directory",x
+                                       """ 
+                                       stat the dir, delete the dir, recreate the dir and set
+                                       the proper perms and ownership
+                                       """
+                                       mystat=os.stat(myemp)
+                                       shutil.rmtree(myemp)
+                                       os.makedirs(myemp,0755)
+                                       os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
+                                       os.chmod(myemp,mystat[ST_MODE])
                        touch(self.settings["autoresume_path"]+"empty")
 
        def remove(self):