From 0ae183fde7726b764aeb8d4f58314494247d4a82 Mon Sep 17 00:00:00 2001 From: Eric Edgar Date: Tue, 26 Apr 2005 18:28:26 +0000 Subject: [PATCH] Fix bug where purge deletes the autoresume directory but doesnt recreate it git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@626 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 +++++- modules/generic_stage_target.py | 24 ++++++++++++++++-------- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 881891bc..6d780fa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.238 2005/04/26 14:58:04 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.239 2005/04/26 18:28:26 rocket Exp $ + + 26 Apr 2005; Eric Edgar + modules/generic_stage_target.py: + Fix bug where purge deletes the autoresume directory but doesnt recreate it 26 Apr 2005; Eric Edgar modules/catalyst_support.py, modules/generic_stage_target.py: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index a1f1a69e..445e2667 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.39 2005/04/26 14:58:04 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.40 2005/04/26 18:28:26 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -722,12 +722,6 @@ class generic_stage_target(generic_target): self.unbind() raise - def clear_autoresume(self): - # clean resume points since they are no longer needed - if self.settings.has_key("AUTORESUME"): - print "Removing AutoResume Points: ..." - cmd("rm -rf "+self.settings["autoresume_path"],\ - "Couldn't remove resume points") def preclean(self): if self.settings.has_key("AUTORESUME") \ @@ -1008,7 +1002,21 @@ class generic_stage_target(generic_target): mystat=os.stat(myemp) shutil.rmtree(myemp) os.makedirs(myemp,0755) - + def clear_autoresume(self): + # clean resume points since they are no longer needed + if self.settings.has_key("AUTORESUME"): + print "Removing AutoResume Points: ..." + myemp=self.settings["autoresume_path"] + if not os.path.isdir(myemp): + print myemp,"not a directory or does not exist, skipping 'pkgcache purge' operation." + else: + print "Emptying directory",myemp + # 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) + def purge(self): countdown(10,"Purging Caches ...") if self.settings.has_key("PURGE"): -- 2.26.2