From: John P. Davis Date: Sat, 18 Dec 2004 04:56:21 +0000 (+0000) Subject: fix for #73851 X-Git-Tag: CATALYST_2_0_6_916~870 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f86d9b8e07e2db497715f819a7809f4012adfec0;p=catalyst.git fix for #73851 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@503 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 09ec4b4b..3e47aef9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,9 @@ # ChangeLog for gentoo/src/catalyst # Copyright 2002-2004 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.130 2004/12/18 04:47:14 zhen Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.131 2004/12/18 04:56:21 zhen Exp $ + + 17 Dec 2004; John Davis modules/generic_stage_target.py: + fix for #73851 17 Dec 2004; John Davis modules/catalyst_support.py: fix for #66592. catalyst now gives a traceback when it bails out, making diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index d5810180..d2dcf213 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.19 2004/12/17 21:18:06 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.20 2004/12/18 04:56:21 zhen Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -287,6 +287,12 @@ class generic_stage_target(generic_target): raise CatalystError, "Can't find envscript "+self.settings["ENVSCRIPT"] cmd("cp "+self.settings["ENVSCRIPT"]+" "+self.settings["chroot_path"]+"/tmp/envscript",\ "Could not copy envscript into place.") + + # copy over /etc/hosts from the host in case there are any specialties in there + if os.path.exists("/etc/hosts"): + cmd("mv "+self.settings["chroot_path"]+"/etc/hosts "+self.settings["chroot_path"]+\ + "/etc/hosts.bck", "Could not backup /etc/hosts") + cmd("cp /etc/hosts "+self.settings["chroot_path"]+"/etc/hosts", "Could not copy /etc/hosts") # modify and write out make.conf (for the chroot) cmd("rm -f "+self.settings["chroot_path"]+"/etc/make.conf") @@ -341,6 +347,10 @@ class generic_stage_target(generic_target): for x in cleanables: print "Cleaning chroot: "+x+"..." cmd("rm -rf "+destpath+x,"Couldn't clean "+x) + + # put /etc/hosts back into place + cmd("mv -f "+self.settings["chroot_path"]+"/etc/hosts.bck "+self.settings["chroot_path"]+\ + "/etc/hosts", "Could not replace /etc/hosts") cmd("/bin/bash "+self.settings["sharedir"]+"/targets/"+self.settings["target"]+\ "/"+self.settings["target"]+".sh clean","clean script failed.")