tiny tweak to ensure we get a new shapshot directory with no cruft every single time
authorDaniel Robbins <drobbins@gentoo.org>
Sun, 22 Feb 2004 19:51:18 +0000 (19:51 +0000)
committerDaniel Robbins <drobbins@gentoo.org>
Sun, 22 Feb 2004 19:51:18 +0000 (19:51 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@242 d1e1f19c-881f-0410-ab34-b69fee027534

modules/targets.py

index 4dfa2340ce54b1c914f8e3b2932d8464391672ee..9df927ebdaf62d77c7467f1ce32a69b93e64d856 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.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)