From 64bbee9ef219618ed0dcec0c91c48dac1189609b Mon Sep 17 00:00:00 2001 From: Daniel Robbins Date: Sun, 22 Feb 2004 19:51:18 +0000 Subject: [PATCH] tiny tweak to ensure we get a new shapshot directory with no cruft every single time git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@242 d1e1f19c-881f-0410-ab34-b69fee027534 --- modules/targets.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/modules/targets.py b/modules/targets.py index 4dfa2340..9df927eb 100644 --- a/modules/targets.py +++ b/modules/targets.py @@ -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.88 2004/02/17 09:55:23 drobbins Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/Attic/targets.py,v 1.89 2004/02/22 19:51:18 drobbins Exp $ import os,string,imp,types,shutil from catalyst_support import * @@ -155,10 +155,11 @@ class generic_stage_target(generic_target): def unpack_and_bind(self): print "Unpacking stage tarball..." cmd("tar xjpf "+self.settings["source_path"]+" -C "+self.settings["chroot_path"],"Error unpacking tarball") - if self.settings["target"] not in ["livecd-stage3"]: - #a livecd-stage2 isn't "cleaned up" so there's no need to re-extract the portage snapshot - print "Unpacking portage tree snapshot..." - cmd("tar xjpf "+self.settings["snapshot_path"]+" -C "+self.settings["chroot_path"]+"/usr","Error unpacking snapshot") + if os.path.exists(self.settings["chroot_path"]+"/usr/portage"): + print "Cleaning up existing portage tree snapshot..." + cmd("rm -rf "+self.settings["chroot_path"]+"/usr/portage","Error removing existing snapshot directory.") + print "Unpacking portage tree snapshot..." + cmd("tar xjpf "+self.settings["snapshot_path"]+" -C "+self.settings["chroot_path"]+"/usr","Error unpacking snapshot") for x in self.mounts: if not os.path.exists(self.settings["chroot_path"]+x): os.makedirs(self.settings["chroot_path"]+x) -- 2.26.2