fix issue where args not allowed that arose due to earlier myspec addlargs bug
authorEric Edgar <rocket@gentoo.org>
Tue, 17 Jan 2006 20:39:15 +0000 (20:39 +0000)
committerEric Edgar <rocket@gentoo.org>
Tue, 17 Jan 2006 20:39:15 +0000 (20:39 +0000)
git-svn-id: svn+ssh://svn.gentoo.org/var/svnroot/catalyst/trunk@1026 d1e1f19c-881f-0410-ab34-b69fee027534

ChangeLog
modules/catalyst_support.py
modules/generic_stage_target.py
modules/livecd_stage2_target.py
modules/stage4_target.py

index fdf048c239e064090eea344b367d0920cd873ef5..ecc70527ff0b3f0fcdb0f02e75d7809526b03fe1 100644 (file)
--- 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 <rocket@gentoo.org> 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 <wolf31o2@gentoo.org>
   targets/embedded/embedded-preclean-chroot.sh,
index 630e0f628599ae1a0bd7245887bc8c897657695e..3121a7230b640aaa4574d39f2e3e2ee783bcd541 100644 (file)
@@ -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."
index 5937ff1ab09258bf9f2474f1006048af48cae623..74951202244905632b11e1cf86e6c947d30ffe9f 100644 (file)
@@ -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"]
index ef21e4753cfc2465bdeead325e00b6abbd12687c..bdb5632e37e447b31f92b257f1a9ee2d40a89c60 100644 (file)
@@ -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"):
index 132312ed6523ea20cdfd7d6b9dc71e2d55f64936..1bffd6db6068bfb3f3e6a10a9b0d85a572acd67c 100644 (file)
@@ -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):