From 3240c350ee4cde8b7e26199239857a5e62ce53d5 Mon Sep 17 00:00:00 2001 From: Chris Gianelloni Date: Wed, 27 Dec 2006 15:48:12 +0000 Subject: [PATCH] Changed the portage_overlay option to always install overlays in /usr/local/portage and added code to clean up /usr/local/portage and make.conf after sucessful execution and before creation of ISO/tarballs. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1200 d1e1f19c-881f-0410-ab34-b69fee027534 --- ChangeLog | 6 ++++++ modules/generic_stage_target.py | 28 +++++++++++++++------------- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc010522..12a8f375 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,12 @@ # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 # $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.664 2006/10/02 20:41:53 wolf31o2 Exp $ + 27 Dec 2006; Chris Gianelloni + modules/generic_stage_target.py: + Changed the portage_overlay option to always install overlays in + /usr/local/portage and added code to clean up /usr/local/portage and + make.conf after sucessful execution and before creation of ISO/tarballs. + 22 Dec 2006; Chris Gianelloni targets/support/livecdfs-update.sh: Fixed a typo which broke coldplugging. diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 18d950ca..147b0824 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -741,18 +741,15 @@ class generic_stage_target(generic_target): "/etc/portage","Error copying /etc/portage",env=self.env) touch(self.settings["autoresume_path"]+"setup_confdir") - def portage_overlay(self): - # copy over the portage overlays - # Always copy over the overlay incase it has changed + def portage_overlay(self): + # Here, we copy the contents of our overlays to /usr/local/portage. We + # always copy over the overlays in case it has changed. if self.settings.has_key("portage_overlay"): for x in self.settings["portage_overlay"]: if os.path.exists(x): print "Copying overlay dir " +x - cmd("mkdir -p "+self.settings["chroot_path"]+x,"Could not make portage_overlay dir",env=self.env) - #cmd("rsync -a --delete "+x+"/* "+self.settings["chroot_path"]+x,\ - cmd("rsync -a --delete "+x+"/ "+self.settings["chroot_path"]+x,\ - "Could not copy portage_overlay",env=self.env) - #cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+x,"Could not copy portage_overlay",env=self.env) + cmd("mkdir -p "+self.settings["chroot_path"]+"/usr/local/portage","Could not make portage_overlay dir",env=self.env) + cmd("cp -R "+x+"/* "+self.settings["chroot_path"]+"/usr/local/portage","Could not copy portage_overlay",env=self.env) def root_overlay(self): # copy over the root_overlay @@ -904,7 +901,8 @@ class generic_stage_target(generic_target): # Setup the portage overlay if self.settings.has_key("portage_overlay"): - myf.write('PORTDIR_OVERLAY="'+string.join(self.settings["portage_overlay"])+'"\n') +# myf.write('PORTDIR_OVERLAY="'+string.join(self.settings["portage_overlay"])+'"\n') + myf.write('PORTDIR_OVERLAY="/usr/local/portage"\n') myf.close() touch(self.settings["autoresume_path"]+"chroot_setup") @@ -938,10 +936,14 @@ class generic_stage_target(generic_target): cmd("rm -rf "+self.settings["destpath"]+x,"Couldn't clean "+x,env=self.env) # put /etc/hosts back into place - if os.path.exists(self.settings["chroot_path"]+"/etc/hosts.bck"): - cmd("mv -f "+self.settings["chroot_path"]+"/etc/hosts.bck "+self.settings["chroot_path"]+\ - "/etc/hosts", "Could not replace /etc/hosts",env=self.env) - + if os.path.exists(self.settings["chroot_path"]+"/etc/hosts.bck"): + cmd("mv -f "+self.settings["chroot_path"]+"/etc/hosts.bck "+self.settings["chroot_path"]+"/etc/hosts", "Could not replace /etc/hosts",env=self.env) + + # remove our overlay + if os.path.exists(self.settings["chroot_path"]+"/usr/local/portage"): + cmd("rm -rf "+self.settings["chroot_path"]+"/usr/local/portage", "Could not remove /usr/local/portage",env=self.env) + cmd("sed -i '/^PORTDIR_OVERLAY/d' "+self.settings["chroot_path"]+"/etc/make.conf", "Could not remove PORTDIR_OVERLAY from make.conf",env=self.env) + if os.path.exists(self.settings["controller_file"]): cmd("/bin/bash "+self.settings["controller_file"]+" clean","clean script failed.",env=self.env) touch(self.settings["autoresume_path"]+"clean") -- 2.26.2