From: Andrew Gaffney Date: Tue, 13 Jan 2009 18:40:59 +0000 (-0600) Subject: Remove all references to 'spec' and 'addlargs' in target modules X-Git-Tag: CATALYST-2.0.10~3^2~157 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cf32a5514e5e48c4901f1fcd8b853f618563ce80;p=catalyst.git Remove all references to 'spec' and 'addlargs' in target modules --- diff --git a/ChangeLog b/ChangeLog index 28551612..82d04e63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS) # Distributed under the GPL v2 + 13 Jan 2009; Andrew Gaffney + modules/catalyst/target/embedded.py, modules/catalyst/target/generic.py, + modules/catalyst/target/generic_stage.py, modules/catalyst/target/grp.py, + modules/catalyst/target/livecd_stage1.py, + modules/catalyst/target/livecd_stage2.py, + modules/catalyst/target/netboot.py, modules/catalyst/target/stage1.py, + modules/catalyst/target/stage2.py, modules/catalyst/target/stage3.py, + modules/catalyst/target/stage4.py, modules/catalyst/target/tinderbox.py: + Remove all references to 'spec' and 'addlargs' in target modules + 13 Jan 2009; Andrew Gaffney modules/catalyst/config.py: All targets have been updated not to use the spec_prefix, so we don't need diff --git a/modules/catalyst/target/embedded.py b/modules/catalyst/target/embedded.py index 9afdc406..ae4ec18b 100644 --- a/modules/catalyst/target/embedded.py +++ b/modules/catalyst/target/embedded.py @@ -15,11 +15,11 @@ from catalyst.output import * class embedded_target(generic_stage_target): - def __init__(self,spec,addlargs): + def __init__(self): self.valid_values = ["empty","rm","unmerge","fs-prepare","fs-finish","mergeroot","packages","fs-type"] self.valid_values += ["runscript","boot/kernel","linuxrc", "use", "fs-ops"] - generic_stage_target.__init__(self,spec,addlargs) + generic_stage_target.__init__() def set_action_sequence(self): self.settings["action_sequence"]=["dir_setup","unpack","unpack_snapshot",\ diff --git a/modules/catalyst/target/generic.py b/modules/catalyst/target/generic.py index a97f13ae..944043cd 100644 --- a/modules/catalyst/target/generic.py +++ b/modules/catalyst/target/generic.py @@ -8,14 +8,14 @@ from catalyst.output import * class generic_target: - def __init__(self, myspec=None, addlargs=None): - if myspec and addlargs: - catalyst.util.addl_arg_parse(myspec,addlargs,self.required_values,self.valid_values) - self.settings=myspec - else: - self.config = catalyst.config.config() - self.settings = self.config.get_spec().get_values() - self.settings.update(self.config.get_conf()) + def __init__(self): +# if myspec and addlargs: +# catalyst.util.addl_arg_parse(myspec,addlargs,self.required_values,self.valid_values) +# self.settings=myspec +# else: + self.config = catalyst.config.config() + self.settings = self.config.get_spec().get_values() + self.settings.update(self.config.get_conf()) self.env={} self.env["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin" diff --git a/modules/catalyst/target/generic_stage.py b/modules/catalyst/target/generic_stage.py index b311bcea..45fa1f90 100644 --- a/modules/catalyst/target/generic_stage.py +++ b/modules/catalyst/target/generic_stage.py @@ -14,8 +14,8 @@ from catalyst.target.generic import * class generic_stage_target(generic_target): - def __init__(self, myspec=None, addlargs=None): - generic_target.__init__(self,myspec,addlargs) + def __init__(self): + generic_target.__init__(self) self.required_values.extend(["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath"]) diff --git a/modules/catalyst/target/grp.py b/modules/catalyst/target/grp.py index 931db9f8..f29437ea 100644 --- a/modules/catalyst/target/grp.py +++ b/modules/catalyst/target/grp.py @@ -11,7 +11,7 @@ from catalyst.spawn import cmd from catalyst.output import * class grp_target(generic_stage_target): - def __init__(self,spec,addlargs): + def __init__(self): self.required_values=["version_stamp","target","subarch",\ "rel_type","profile","snapshot","source_subpath"] @@ -32,7 +32,7 @@ class grp_target(generic_stage_target): self.required_values.append("grp/"+x+"/packages") self.required_values.append("grp/"+x+"/type") - generic_stage_target.__init__(self,spec,addlargs) + generic_stage_target.__init__(self) def set_target_path(self): self.settings["target_path"]=catalyst.util.normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/") diff --git a/modules/catalyst/target/livecd_stage1.py b/modules/catalyst/target/livecd_stage1.py index a66fc208..39667f6a 100644 --- a/modules/catalyst/target/livecd_stage1.py +++ b/modules/catalyst/target/livecd_stage1.py @@ -9,12 +9,12 @@ from catalyst.spawn import cmd from catalyst.output import * class livecd_stage1_target(generic_stage_target): - def __init__(self,spec,addlargs): + def __init__(self): self.required_values=["livecd/packages"] self.valid_values=self.required_values[:] self.valid_values.extend(["livecd/use"]) - generic_stage_target.__init__(self,spec,addlargs) + generic_stage_target.__init__(self) def set_action_sequence(self): self.settings["action_sequence"]=["unpack","unpack_snapshot",\ diff --git a/modules/catalyst/target/livecd_stage2.py b/modules/catalyst/target/livecd_stage2.py index 35675db1..c566c480 100644 --- a/modules/catalyst/target/livecd_stage2.py +++ b/modules/catalyst/target/livecd_stage2.py @@ -11,7 +11,7 @@ from catalyst.spawn import cmd from catalyst.output import * class livecd_stage2_target(generic_stage_target): - def __init__(self,spec,addlargs): + def __init__(self): self.required_values=["boot/kernel"] self.valid_values=[] @@ -26,7 +26,7 @@ class livecd_stage2_target(generic_stage_target): "livecd/fstype","livecd/fsops","livecd/linuxrc","livecd/bootargs",\ "gamecd/conf","livecd/xdm","livecd/xsession","livecd/volid"]) - generic_stage_target.__init__(self,spec,addlargs) + generic_stage_target.__init__(self) if not "livecd/type" in self.settings: self.settings["livecd/type"] = "generic-livecd" diff --git a/modules/catalyst/target/netboot.py b/modules/catalyst/target/netboot.py index 55156edd..313b958d 100644 --- a/modules/catalyst/target/netboot.py +++ b/modules/catalyst/target/netboot.py @@ -11,7 +11,9 @@ from catalyst.spawn import cmd from catalyst.output import * class netboot_target(generic_stage_target): - def __init__(self,spec,addlargs): + def __init__(self): + generic_stage_target.__init__(self) + self.required_values=[ "boot/kernel" ] @@ -27,18 +29,17 @@ class netboot_target(generic_stage_target): ]) try: - if "netboot/packages" in addlargs: + if "netboot/packages" in self.settings: if type(addlargs["netboot/packages"]) == types.StringType: - loopy=[addlargs["netboot/packages"]] + loopy=[self.settings["netboot/packages"]] else: - loopy=addlargs["netboot/packages"] + loopy=self.settings["netboot/packages"] for x in loopy: self.valid_values.append("netboot/packages/"+x+"/files") except: raise CatalystError,"configuration error in netboot/packages." - generic_stage_target.__init__(self,spec,addlargs) self.settings["merge_path"]=catalyst.util.normpath("/tmp/image/") def set_target_path(self): diff --git a/modules/catalyst/target/stage1.py b/modules/catalyst/target/stage1.py index c0b9fb0b..82403920 100644 --- a/modules/catalyst/target/stage1.py +++ b/modules/catalyst/target/stage1.py @@ -8,10 +8,12 @@ import catalyst from catalyst.output import * class stage1_target(generic_stage_target): - def __init__(self,spec,addlargs): + + def __init__(self): + generic_stage_target.__init__(self) + self.required_values=[] self.valid_values=["chost"] - generic_stage_target.__init__(self,spec,addlargs) def set_stage_path(self): self.settings["stage_path"]=catalyst.util.normpath(self.settings["chroot_path"]+self.settings["root_path"]) diff --git a/modules/catalyst/target/stage2.py b/modules/catalyst/target/stage2.py index 68e8c8df..8ecad3ce 100644 --- a/modules/catalyst/target/stage2.py +++ b/modules/catalyst/target/stage2.py @@ -8,10 +8,12 @@ import catalyst from catalyst.output import * class stage2_target(generic_stage_target): - def __init__(self,spec,addlargs): + + def __init__(self): + generic_stage_target.__init__(self) + self.required_values=[] self.valid_values=["chost"] - generic_stage_target.__init__(self,spec,addlargs) def set_source_path(self): if "SEEDCACHE" in self.settings and os.path.isdir(catalyst.util.normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")): diff --git a/modules/catalyst/target/stage3.py b/modules/catalyst/target/stage3.py index 6ae7e100..5367a2ac 100644 --- a/modules/catalyst/target/stage3.py +++ b/modules/catalyst/target/stage3.py @@ -6,10 +6,12 @@ Builder class for a stage3 installation tarball build. from generic_stage import * class stage3_target(generic_stage_target): - def __init__(self,spec,addlargs): + + def __init__(self): + generic_stage_target.__init__(self) + self.required_values=[] self.valid_values=[] - generic_stage_target.__init__(self,spec,addlargs) def set_portage_overlay(self): generic_stage_target.set_portage_overlay(self) diff --git a/modules/catalyst/target/stage4.py b/modules/catalyst/target/stage4.py index 33f989b6..074a920e 100644 --- a/modules/catalyst/target/stage4.py +++ b/modules/catalyst/target/stage4.py @@ -6,7 +6,10 @@ Builder class for stage4. from generic_stage import * class stage4_target(generic_stage_target): - def __init__(self,spec,addlargs): + + def __init__(self): + generic_stage_target.__init__(self) + self.required_values=["stage4/packages"] self.valid_values=self.required_values[:] self.valid_values.extend(["stage4/use","boot/kernel",\ @@ -14,7 +17,6 @@ class stage4_target(generic_stage_target): "stage4/gk_mainargs","splash_theme",\ "portage_overlay","stage4/rcadd","stage4/rcdel",\ "stage4/linuxrc","stage4/unmerge","stage4/rm","stage4/empty"]) - generic_stage_target.__init__(self,spec,addlargs) def set_cleanables(self): self.settings["cleanables"]=["/var/tmp/*","/tmp/*"] diff --git a/modules/catalyst/target/tinderbox.py b/modules/catalyst/target/tinderbox.py index 00f58505..a1cbd787 100644 --- a/modules/catalyst/target/tinderbox.py +++ b/modules/catalyst/target/tinderbox.py @@ -9,11 +9,13 @@ from catalyst.error import * from catalyst.spawn import cmd class tinderbox_target(generic_stage_target): - def __init__(self,spec,addlargs): + + def __init__(self): + generic_stage_target.__init__(self) + self.required_values=["tinderbox/packages"] self.valid_values=self.required_values[:] self.valid_values.extend(["tinderbox/use"]) - generic_stage_target.__init__(self,spec,addlargs) def run_local(self): # tinderbox