From: Eric Edgar Date: Thu, 23 Jun 2005 15:42:50 +0000 (+0000) Subject: Allow changing the location of the pkg_cache in stage4 or livecd-stage1 X-Git-Tag: CATALYST_2_0_6_916~714 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=f15af45375e2220b35e3fec2d0a762158e68bff6;p=catalyst.git Allow changing the location of the pkg_cache in stage4 or livecd-stage1 git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@710 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index 509833c0..b0247f48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.276 2005/06/22 18:53:49 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.277 2005/06/23 15:42:50 rocket Exp $ + + 23 Jun 2005; Eric Edgar + modules/generic_stage_target.py, modules/livecd_stage1_target.py, + modules/stage4_target.py: + Allow changing the location of the pkg_cache in stage4 or livecd-stage1 22 Jun 2005; Eric Edgar : Fix issue where -s on the command line would not run diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 73a4258c..b14d6cf0 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.46 2005/05/18 18:09:14 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.47 2005/06/23 15:42:50 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -147,7 +147,8 @@ class generic_stage_target(generic_target): # configure any user specified options (either in catalyst.conf or on the cmdline) if self.settings.has_key("PKGCACHE"): - self.settings["pkgcache_path"]=self.settings["storedir"]+"/packages/"+self.settings["target_subpath"] + self.set_pkgcache_path() + print "Location of the package cache is" + self.settings["pkgcache_path"] self.mounts.append("/usr/portage/packages") self.mountmap["/usr/portage/packages"]=self.settings["pkgcache_path"] @@ -207,6 +208,10 @@ class generic_stage_target(generic_target): self.settings["target_subpath"]=self.settings["rel_type"]+"/"+self.settings["target"]+\ "-"+self.settings["subarch"]+"-"+self.settings["version_stamp"] + def set_pkgcache_path(self): + self.settings["pkgcache_path"]=self.settings["storedir"]+"/packages/"+\ + self.settings["target_subpath"] + def set_target_path(self): self.settings["target_path"]=self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+".tar.bz2" if self.settings.has_key("AUTORESUME") \ diff --git a/modules/livecd_stage1_target.py b/modules/livecd_stage1_target.py index 3fae8386..2b93e865 100644 --- a/modules/livecd_stage1_target.py +++ b/modules/livecd_stage1_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/livecd_stage1_target.py,v 1.12 2005/04/27 17:44:58 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage1_target.py,v 1.13 2005/06/23 15:42:50 rocket Exp $ """ Builder class for LiveCD stage1. @@ -46,6 +46,13 @@ class livecd_stage1_target(generic_stage_target): if self.settings.has_key(self.settings["spec_prefix"]+"/packages"): self.settings[self.settings["spec_prefix"]+"/packages"].append("livecd-tools") + def set_pkgcache_path(self): + if self.settings.has_key("pkgcache_path"): + if type(self.settings["pkgcache_path"]) != types.StringType: + self.settings["pkgcache_path"]=string.join(self.settings["pkgcache_path"]) + else: + generic_stage_target.set_pkgcache_path(self) + def register(foo): foo.update({"livecd-stage1":livecd_stage1_target}) return foo diff --git a/modules/stage4_target.py b/modules/stage4_target.py index cbc5acb1..fe6b62a3 100644 --- a/modules/stage4_target.py +++ b/modules/stage4_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/stage4_target.py,v 1.6 2005/04/27 17:59:35 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage4_target.py,v 1.7 2005/06/23 15:42:50 rocket Exp $ """ Builder class for LiveCD stage1. @@ -17,7 +17,14 @@ class stage4_target(generic_stage_target): self.valid_values.extend(["stage4/use", "stage4/packages", "stage4/root_overlay", "stage4/fsscript", \ "stage4/rcadd","stage4/rcdel"]) generic_stage_target.__init__(self,spec,addlargs) - + + def set_pkgcache_path(self): + if self.settings.has_key("pkgcache_path"): + if type(self.settings["pkgcache_path"]) != types.StringType: + self.settings["pkgcache_path"]=string.join(self.settings["pkgcache_path"]) + else: + generic_stage_target.set_pkgcache_path(self) + def set_cleanables(self): self.settings["cleanables"]=["/var/tmp/*","/tmp/*"]