fix for #73851
authorJohn P. Davis <zhen@gentoo.org>
Sat, 18 Dec 2004 04:56:21 +0000 (04:56 +0000)
committerJohn P. Davis <zhen@gentoo.org>
Sat, 18 Dec 2004 04:56:21 +0000 (04:56 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@503 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/generic_stage_target.py

index 09ec4b4b69a40f17e3423af77a2dc1cf1e5dd968..3e47aef9b21539c2536b010340c05693764d7404 100644 (file)
--- 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 <zhen@gentoo.org> modules/generic_stage_target.py:
+  fix for #73851
 
   17 Dec 2004; John Davis <zhen@gentoo.org> modules/catalyst_support.py:
   fix for #66592. catalyst now gives a traceback when it bails out, making
index d58101803b766473a3aad0746c6c43db41d4060c..d2dcf21359c9dea6fcc566a7b59fc968e8549231 100644 (file)
@@ -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.")