bugfix for #63033
authorJohn P. Davis <zhen@gentoo.org>
Tue, 7 Sep 2004 14:04:24 +0000 (14:04 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Tue, 7 Sep 2004 14:04:24 +0000 (14:04 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@432 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/generic_stage_target.py
modules/livecd_stage2_target.py

index 3e2c1322131f0601a1b26c3aee474f7dc52ceb92..c3ad91192aca94678846c5defc93d3fb498cf5b6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,10 @@
 # ChangeLog for gentoo/src/catalyst 
 # Copyright 2002-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.79 2004/08/31 01:40:24 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.80 2004/09/07 14:04:24 zhen Exp $
+
+  07 Sep 2004; John Davis <zhen@gentoo.org> modules/generic_stage_target.py,
+  modules/livecd_stage2_target.py:
+  fix for bug #63033, thanks to usata@gentoo.org for the patch
 
   30 Aug 2004; John Davis <zhen@gentoo.org>
   livecd/runscript-support/livecdfs-update.sh, targets/grp/grp-chroot.sh:
index 73e3a86ef9b164f9fdabb266831b85a072c199c5..c404b112cc5937c84b0e764b571b5b6b1b309473 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/generic_stage_target.py,v 1.11 2004/08/13 16:00:48 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.12 2004/09/07 14:04:24 zhen Exp $
 
 """
 This class does all of the chroot setup, copying of files, etc. It is
@@ -362,7 +362,7 @@ class generic_stage_target(generic_target):
                
                except:
                        self.unbind()
-                       raise
+                       raise CatalystError, "Build failed, could not execute preclean"
 
        def capture(self):
                """capture target in a tarball"""
@@ -425,18 +425,20 @@ class generic_stage_target(generic_target):
                                os.environ[varname]=string.join(self.settings[x])
                        
                self.run_local()
-               if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage2"]:
+               if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage1","livecd-stage2"]:
                        self.preclean()
                
                if self.settings["target"] in ["livecd-stage2"]:
                        self.unmerge()
+               
+               # unbind everything here so that we can clean()
                self.unbind()
                
                # kill distcc processes outside of the chroot
                if self.settings.has_key("DISTCC"): 
                        cmd("/usr/bin/pkill -U 7980","could not kill distcc process(es)")
 
-               if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage2"]:
+               if self.settings["target"] in ["stage1","stage2","stage3","livecd-stage1","livecd-stage2"]:
                        # clean is for removing things after bind-mounts are 
                        # unmounted (general file removal and cleanup)
                        self.clean()
index 0cca6de52376bb2049d207035fc65a91e349051e..79d2c2818fc4c2fd34913a7c346ba209bf4f2072 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/livecd_stage2_target.py,v 1.19 2004/09/06 04:52:06 zhen Exp $
+# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.20 2004/09/07 14:04:24 zhen Exp $
 
 """
 Builder class for a LiveCD stage2 build.
@@ -50,8 +50,18 @@ class livecd_stage2_target(generic_stage_target):
                        os.makedirs(self.settings["chroot_path"])
                                
                print "Copying livecd-stage1 result to new livecd-stage2 work directory..."
-               cmd("rsync -a --delete "+self.settings["source_path"]+"/* "+self.settings["chroot_path"],"Error copying initial livecd-stage2")
+               cmd("rsync -a --delete "+self.settings["source_path"]+"/* "+self.settings["chroot_path"],\
+                       "Error copying initial livecd-stage2")
        
+               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")
+
                print "Configuring profile link..."
                cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.profile","Error zapping profile link")
                cmd("ln -sf ../usr/portage/profiles/"+self.settings["target_profile"]+" "