From: Andrew Gaffney Date: Tue, 26 Feb 2008 03:11:14 +0000 (+0000) Subject: Fix leading whitespace in empty() so it's only executed if there's something to execu... X-Git-Tag: CATALYST_2_0_6_916~168 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2362ad885ed2ff41aebc2d630d3d377913ca5177;p=catalyst.git Fix leading whitespace in empty() so it's only executed if there's something to execute it on. Thanks to Justin Bronder in bug 211410 for pointing this out git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1326 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index f7c92c44..2f889e17 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ # Copyright 2002-2008 Gentoo Foundation; Distributed under the GPL v2 # $Id: $ + 26 Feb 2008; Andrew Gaffney + 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 in bug + 211410 for pointing this out + 21 Feb 2008; Andrew Gaffney targets/support/rc-update.sh: Quote baselayout package atom diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index c4e81d14..b6ee5409 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -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):