From: John P. Davis Date: Tue, 7 Sep 2004 14:04:24 +0000 (+0000) Subject: bugfix for #63033 X-Git-Tag: CATALYST_2_0_6_916~941 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1c9cd38ada093e8fa268c79b05ccc32b041458bb;p=catalyst.git bugfix for #63033 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@432 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 3e2c1322..c3ad9119 100644 --- 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 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 livecd/runscript-support/livecdfs-update.sh, targets/grp/grp-chroot.sh: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 73e3a86e..c404b112 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.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/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() diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index 0cca6de5..79d2c281 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_stage2_target.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/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"]+" "