From: Eric Edgar Date: Tue, 17 Jan 2006 20:39:15 +0000 (+0000) Subject: fix issue where args not allowed that arose due to earlier myspec addlargs bug X-Git-Tag: CATALYST_2_0_6_916~468 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=af8fad1baca61ea21e679bee686d3d9170624516;p=catalyst.git fix issue where args not allowed that arose due to earlier myspec addlargs bug git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1026 d1e1f19c-881f-0410-ab34-b69fee027534 --- diff --git a/ChangeLog b/ChangeLog index fdf048c2..ecc70527 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ # Copyright 2002-2006 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.511 2006/01/17 19:30:44 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/ChangeLog,v 1.512 2006/01/17 20:39:15 rocket Exp $ + + 17 Jan 2006; Eric Edgar modules/catalyst_support.py, + modules/generic_stage_target.py, modules/livecd_stage2_target.py, + modules/stage4_target.py: + fix issue where args not allowed that arose due to earlier myspec addlargs bug 17 Jan 2006; Chris Gianelloni targets/embedded/embedded-preclean-chroot.sh, diff --git a/modules/catalyst_support.py b/modules/catalyst_support.py index 630e0f62..3121a723 100644 --- a/modules/catalyst_support.py +++ b/modules/catalyst_support.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/catalyst_support.py,v 1.67 2006/01/13 15:09:07 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/catalyst_support.py,v 1.68 2006/01/17 20:39:15 rocket Exp $ import sys,string,os,types,re,signal,traceback,time #import md5,sha @@ -705,11 +705,13 @@ def arg_parse(cmdline): def addl_arg_parse(myspec,addlargs,requiredspec,validspec): "helper function to help targets parse additional arguments" global valid_config_file_values + for x in addlargs.keys(): - if x not in validspec and x not in valid_config_file_values: + if x not in validspec and x not in valid_config_file_values and x not in requiredspec: raise CatalystError, "Argument \""+x+"\" not recognized." else: myspec[x]=addlargs[x] + for x in requiredspec: if not myspec.has_key(x): raise CatalystError, "Required argument \""+x+"\" not specified." diff --git a/modules/generic_stage_target.py b/modules/generic_stage_target.py index 5937ff1a..74951202 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.116 2006/01/16 07:18:28 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/generic_stage_target.py,v 1.117 2006/01/17 20:39:15 rocket Exp $ """ This class does all of the chroot setup, copying of files, etc. It is @@ -15,15 +15,15 @@ import catalyst_lock class generic_stage_target(generic_target): def __init__(self,myspec,addlargs): - self.required_values.extend(["version_stamp","target","subarch","rel_type",\ "profile","snapshot","source_subpath"]) self.valid_values.extend(["version_stamp","target","subarch","rel_type","profile",\ "snapshot","source_subpath","portage_confdir","cflags","cxxflags",\ "ldflags","chost","hostuse","portage_overlay","distcc_hosts"]) - generic_target.__init__(self,myspec,addlargs) + self.set_valid_build_kernel_vars(addlargs) + generic_target.__init__(self,myspec,addlargs) # map the mainarch we are running under to the mainarches we support for # building stages and LiveCDs. (for example, on amd64, we can build stages for # x86 or amd64. @@ -91,7 +91,6 @@ class generic_stage_target(generic_target): except IOError: msg("Can't find "+x+".py plugin in "+self.settings["sharedir"]+"/arch/") - # call arch constructor, pass our settings try: self.arch=self.subarchmap[self.settings["subarch"]](self.settings) @@ -136,7 +135,7 @@ class generic_stage_target(generic_target): self.set_use() self.set_cleanables() self.set_iso_volume_id() - self.set_build_kernel_vars(addlargs) + self.set_build_kernel_vars() self.set_fsscript() self.set_archscript() self.set_runscript() @@ -151,6 +150,9 @@ class generic_stage_target(generic_target): self.set_rm() self.set_linuxrc() self.set_portage_overlay() + + addl_arg_parse(myspec,addlargs,self.required_values,self.valid_values) + # 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) @@ -447,13 +449,12 @@ class generic_stage_target(generic_target): # ROOT= variable for emerges self.settings["root_path"]="/" - def set_build_kernel_vars(self,addlargs): - - if addlargs.has_key("boot/kernel"): - if type(addlargs["boot/kernel"]) == types.StringType: - loopy=[addlargs["boot/kernel"]] - else: - loopy=addlargs["boot/kernel"] + def set_valid_build_kernel_vars(self,addlargs): + if addlargs.has_key("boot/kernel"): + if type(addlargs["boot/kernel"]) == types.StringType: + loopy=[addlargs["boot/kernel"]] + else: + loopy=addlargs["boot/kernel"] for x in loopy: self.required_values.append("boot/kernel/"+x+"/sources") @@ -466,18 +467,20 @@ class generic_stage_target(generic_target): self.valid_values.append("boot/kernel/"+x+"/gk_action") self.valid_values.append("boot/kernel/"+x+"/initramfs_overlay") self.valid_values.append("boot/kernel/"+x+"/softlevel") - if self.settings.has_key("boot/kernel/"+x+"/postconf"): + self.valid_values.append("boot/kernel/"+x+"/postconf") + if addlargs.has_key("boot/kernel/"+x+"/postconf"): print "boot/kernel/"+x+"/postconf is deprecated" print "\tInternally moving these ebuilds to boot/kernel/"+x+"/packages" print "\tPlease move them to boot/kernel/"+x+"/packages in your specfile" - if type(self.settings["boot/kernel/"+x+"/postconf"]) == types.StringType: - loop2=[self.settings["boot/kernel/"+x+"/postconf"]] + if type(addlargs["boot/kernel/"+x+"/postconf"]) == types.StringType: + loop2=[addlargs["boot/kernel/"+x+"/postconf"]] else: - loop2=self.settings["boot/kernel/"+x+"/postconf"] + loop2=addlargs["boot/kernel/"+x+"/postconf"] for y in loop2: - self.settings["boot/kernel/"+x+"/packages"].append(y) + addlargs["boot/kernel/"+x+"/packages"].append(y) + def set_build_kernel_vars(self): if self.settings.has_key(self.settings["spec_prefix"]+"/devmanager"): self.settings["devmanager"]=self.settings[self.settings["spec_prefix"]+"/devmanager"] del self.settings[self.settings["spec_prefix"]+"/devmanager"] diff --git a/modules/livecd_stage2_target.py b/modules/livecd_stage2_target.py index ef21e475..bdb5632e 100644 --- a/modules/livecd_stage2_target.py +++ b/modules/livecd_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/livecd_stage2_target.py,v 1.58 2005/12/19 20:53:13 rocket Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/livecd_stage2_target.py,v 1.59 2006/01/17 20:39:15 rocket Exp $ """ Builder class for a LiveCD stage2 build. @@ -24,8 +24,8 @@ class livecd_stage2_target(generic_stage_target): "livecd/rcadd","livecd/rcdel","livecd/fsscript","livecd/xinitrc",\ "livecd/root_overlay","livecd/devmanager","livecd/users",\ "gamecd/conf","livecd/users","portage_overlay","livecd/cdfstype",\ - "livecd/linuxrc","livecd/bootargs","gamecd/conf","livecd/xdm",\ - "livecd/xsession"]) + "livecd/fstype","livecd/linuxrc","livecd/bootargs","gamecd/conf",\ + "livecd/xdm","livecd/xsession"]) generic_stage_target.__init__(self,spec,addlargs) if not self.settings.has_key("livecd/type"): diff --git a/modules/stage4_target.py b/modules/stage4_target.py index 132312ed..1bffd6db 100644 --- a/modules/stage4_target.py +++ b/modules/stage4_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/stage4_target.py,v 1.16 2006/01/10 19:32:47 wolf31o2 Exp $ +# $Header: /var/cvsroot/gentoo/src/catalyst/modules/stage4_target.py,v 1.17 2006/01/17 20:39:15 rocket Exp $ """ Builder class for stage4. @@ -14,7 +14,7 @@ class stage4_target(generic_stage_target): self.required_values=[] self.valid_values=self.required_values[:] self.valid_values.extend(["stage4/use","stage4/packages","stage4/root_overlay", "stage4/fsscript", \ - "stage4/rcadd","stage4/rcdel","stage4/linuxrc","chost","cflags","ldflags","cxxflags"]) + "stage4/rcadd","stage4/rcdel","stage4/linuxrc","chost","cflags","ldflags","cxxflags","boot/kernel"]) generic_stage_target.__init__(self,spec,addlargs) def set_cleanables(self):