From: Eric Edgar Date: Tue, 13 Dec 2005 20:32:43 +0000 (+0000) Subject: allow portdir_overlay to be part of all specs not including snapshot spec. Add warni... X-Git-Tag: CATALYST_2_0_6_916~530 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=7ba40d21137db5a9ea49762dc2da414f067fd227;p=catalyst.git allow portdir_overlay to be part of all specs not including snapshot spec. Add warnings for stage1,2 and 3 in case someone uses this feature there. Remove overlay support from the snapshot spec but added a warning. git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@964 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 6439bad5..260263dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.451 2005/12/13 19:31:13 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.452 2005/12/13 20:32:43 rocket Exp $ + + 13 Dec 2005; Eric Edgar + modules/generic_stage_target.py, modules/snapshot_target.py, + modules/stage1_target.py, modules/stage2_target.py, + modules/stage3_target.py: + allow portdir_overlay to be part of all specs not including snapshot spec. + Add warnings for stage1,2 and 3 in case someone uses this feature there. + Remove overlay support from the snapshot spec but added a warning. 13 Dec 2005; Eric Edgar modules/stage1_target.py, modules/stage2_target.py: diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 6c55e7cb..5d503df5 100644 --- a/modules/generic_stage_target.py +++ b/modules/generic_stage_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 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.97 2005/12/11 20:34:42 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.98 2005/12/13 20:32:43 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -145,7 +145,7 @@ class generic_stage_target(generic_target): self.set_iso() self.set_packages() self.set_rm() - + self.set_portage_overlay() # this next line checks to make sure that the specified variables exist on disk. #pdb.set_trace() file_locate(self.settings,["source_path","snapshot_path","distdir"],expand=0) @@ -390,7 +390,7 @@ class generic_stage_target(generic_target): def set_action_sequence(self): #Default action sequence for run method self.settings["action_sequence"]=["unpack","unpack_snapshot",\ - "config_profile_link","setup_confdir","bind","chroot_setup",\ + "config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\ "setup_environment","run_local","preclean","unbind","clean","capture","clear_autoresume"] def set_use(self): @@ -415,6 +415,11 @@ class generic_stage_target(generic_target): if type(self.settings[self.settings["spec_prefix"]+"/rm"])==types.StringType: self.settings[self.settings["spec_prefix"]+"/rm"]=self.settings[self.settings["spec_prefix"]+"/rm"].split() + def set_portage_overlay(self): + if self.settings.has_key("portage_overlay"): + if type(self.settings["portage_overlay"])==types.StringType: + self.settings["portage_overlay"]=[self.settings["portage_overlay"]] + def set_root_path(self): # ROOT= variable for emerges self.settings["root_path"]="/" @@ -685,9 +690,6 @@ class generic_stage_target(generic_target): # copy over the portage overlays # Always copy over the overlay incase it has changed if self.settings.has_key("portage_overlay"): - if type(self.settings["portage_overlay"])==types.StringType: - self.settings["portage_overlay"]=[self.settings["portage_overlay"]] - for x in self.settings["portage_overlay"]: if os.path.exists(x): print "Copying overlay dir " +x diff --git a/modules/snapshot_target.py b/modules/snapshot_target.py index 0dbba4bd..dacda68c 100644 --- a/modules/snapshot_target.py +++ b/modules/snapshot_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.13 2005/12/05 18:13:12 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/snapshot_target.py,v 1.14 2005/12/13 20:32:43 rocket Exp $ """ Builder class for snapshots. @@ -22,6 +22,13 @@ class snapshot_target(generic_target): self.settings["snapshot_path"]=normpath(st+"/snapshots/portage-"+self.settings["version_stamp"]\ +".tar.bz2") self.settings["tmp_path"]=normpath(st+"/tmp/"+self.settings["target_subpath"]) + if self.settings.has_key("portdir_overlay"): + print "\nWarning!!!!" + print "\tThis feature is deprecated no overlay will be added to the snapshot." + print "\tIf you need an overlay feature please use portdir_overlay in the other spec files" + print "\tOtherwise add your files to the normal snapshot and redigest .. you should know what" + print "\t\tto do." + print "\tThis was removed due to digesting issues that are incompatible with portage." def setup(self): x=normpath(self.settings["storedir"]+"/snapshots") @@ -43,11 +50,11 @@ class snapshot_target(generic_target): cmd("rsync -a --delete --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ "+\ self.settings["portdir"]+"/ "+mytmp+"/portage/","Snapshot failure",env=self.env) - if self.settings.has_key("portdir_overlay"): - print "Adding Portage overlay to the snapshot..." - cmd("rsync -a --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ "+\ - self.settings["portdir_overlay"]+"/ "+mytmp+"/portage/","Snapshot/ overlay addition failure",\ - env=self.env) + #if self.settings.has_key("portdir_overlay"): + #print "Adding Portage overlay to the snapshot..." + #cmd("rsync -a --exclude /packages/ --exclude /distfiles/ --exclude /local/ --exclude CVS/ "+\ + # self.settings["portdir_overlay"]+"/ "+mytmp+"/portage/","Snapshot/ overlay addition failure",\ + # env=self.env) print "Compressing Portage snapshot tarball..." cmd("tar cjf "+self.settings["snapshot_path"]+" -C "+mytmp+" portage",\ diff --git a/modules/stage1_target.py b/modules/stage1_target.py index cbb58e00..578f859c 100644 --- a/modules/stage1_target.py +++ b/modules/stage1_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.17 2005/12/13 19:31:13 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage1_target.py,v 1.18 2005/12/13 20:32:43 rocket Exp $ """ Builder class for a stage1 installation tarball build. @@ -28,6 +28,12 @@ class stage1_target(generic_stage_target): generic_stage_target.set_cleanables(self) self.settings["cleanables"].extend(["/usr/share/gettext","/usr/lib/python2.2/test", "/usr/lib/python2.2/encodings","/usr/lib/python2.2/email", "/usr/lib/python2.2/lib-tk","/usr/share/zoneinfo"]) + def set_portage_overlay(self): + generic_stage_target.set_portage_overlay(self) + print "\nWARNING !!!!!" + print "\tUsing an overlay for earlier stages could cause build issues." + print "\tIf you break it, you buy it. Don't complain to us about it." + print "\tDont say we did not warn you\n" def register(foo): foo.update({"stage1":stage1_target}) return foo diff --git a/modules/stage2_target.py b/modules/stage2_target.py index a2d9aa6f..e2331fa0 100644 --- a/modules/stage2_target.py +++ b/modules/stage2_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage2_target.py,v 1.8 2005/12/13 19:31:13 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage2_target.py,v 1.9 2005/12/13 20:32:43 rocket Exp $ """ Builder class for a stage2 installation tarball build. @@ -56,6 +56,13 @@ class stage2_target(generic_stage_target): if self.settings.has_key("ldflags"): self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"]) + def set_portage_overlay(self): + generic_stage_target.set_portage_overlay(self) + print "\nWARNING !!!!!" + print "\tUsing an overlay for earlier stages could cause build issues." + print "\tIf you break it, you buy it. Don't complain to us about it." + print "\tDont say we did not warn you\n" + def register(foo): foo.update({"stage2":stage2_target}) diff --git a/modules/stage3_target.py b/modules/stage3_target.py index c951e57c..f60d5d25 100644 --- a/modules/stage3_target.py +++ b/modules/stage3_target.py @@ -1,6 +1,6 @@ # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage3_target.py,v 1.4 2005/07/05 21:53:41 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage3_target.py,v 1.5 2005/12/13 20:32:43 rocket Exp $ """ Builder class for a stage3 installation tarball build. @@ -15,6 +15,13 @@ class stage3_target(generic_stage_target): self.valid_values=[] generic_stage_target.__init__(self,spec,addlargs) + def set_portage_overlay(self): + generic_stage_target.set_portage_overlay(self) + print "\nWARNING !!!!!" + print "\tUsing an overlay for earlier stages could cause build issues." + print "\tIf you break it, you buy it. Don't complain to us about it." + print "\tDont say we did not warn you\n" + def register(foo): foo.update({"stage3":stage3_target}) return foo