Move base stage and target files to thier own sub-pkg
authorBrian Dolbec <dolsen@gentoo.org>
Tue, 12 Feb 2013 03:51:52 +0000 (19:51 -0800)
committerBrian Dolbec <dolsen@gentoo.org>
Thu, 28 Feb 2013 01:38:13 +0000 (17:38 -0800)
Fix an indent error in grp_target.py

17 files changed:
catalyst/base/__init__.py [new file with mode: 0644]
catalyst/base/clearbase.py [moved from catalyst/targets/clearbase.py with 100% similarity]
catalyst/base/genbase.py [moved from catalyst/targets/genbase.py with 100% similarity]
catalyst/base/stagebase.py [moved from catalyst/targets/generic_stage_target.py with 99% similarity]
catalyst/base/targetbase.py [moved from catalyst/targets/targetbase.py with 100% similarity]
catalyst/targets/embedded_target.py
catalyst/targets/grp_target.py
catalyst/targets/livecd_stage1_target.py
catalyst/targets/livecd_stage2_target.py
catalyst/targets/netboot2_target.py
catalyst/targets/netboot_target.py
catalyst/targets/snapshot_target.py
catalyst/targets/stage1_target.py
catalyst/targets/stage2_target.py
catalyst/targets/stage3_target.py
catalyst/targets/stage4_target.py
catalyst/targets/tinderbox_target.py

diff --git a/catalyst/base/__init__.py b/catalyst/base/__init__.py
new file mode 100644 (file)
index 0000000..8b13789
--- /dev/null
@@ -0,0 +1 @@
+
similarity index 99%
rename from catalyst/targets/generic_stage_target.py
rename to catalyst/base/stagebase.py
index f764937028bcd07680318c719ffe6c13177838af..8f4bad8eda774b3dfac2cb994471eccecdefbdf6 100644 (file)
@@ -10,13 +10,13 @@ from stat import ST_UID, ST_GID, ST_MODE
 
 from catalyst.support import (CatalystError, msg, file_locate, normpath,
        touch, cmd, warn, list_bashify, read_makeconf, read_from_clst, ismount)
-from catalyst.targets.targetbase import TargetBase
-from catalyst.targets.clearbase import ClearBase
-from catalyst.targets.genbase import GenBase
+from catalyst.base.targetbase import TargetBase
+from catalyst.base.clearbase import ClearBase
+from catalyst.base.genbase import GenBase
 from catalyst.lock import LockDir
 
 
-class generic_stage_target(TargetBase, ClearBase, GenBase):
+class StageBase(TargetBase, ClearBase, GenBase):
        """
        This class does all of the chroot setup, copying of files, etc. It is
        the driver class for pretty much everything that Catalyst does.
index cbc2684da2c93fe6b9a0556d7d6b1d26cf3d7c08..528d5457e7931d81381ed84cb46cc6f7d7dbe46d 100644 (file)
@@ -13,9 +13,9 @@ ROOT=/tmp/submerge emerge --something foo bar .
 
 from catalyst.support import normpath
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
-class embedded_target(generic_stage_target):
+class embedded_target(StageBase):
        """
        Builder class for embedded target
        """
@@ -27,7 +27,7 @@ class embedded_target(generic_stage_target):
                if "embedded/fs-type" in addlargs:
                        self.valid_values.append("embedded/fs-ops")
 
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
                self.set_build_kernel_vars(addlargs)
 
        def set_action_sequence(self):
index abc6b964e7ec157087919642a6eb2e16abb2ef82..02279c3f9b1d7d3d63f01fa70abdf373a680c78d 100644 (file)
@@ -11,10 +11,10 @@ import glob
 from catalyst.support import (CatalystError, normpath,
        touch, cmd, list_bashify)
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class grp_target(generic_stage_target):
+class grp_target(StageBase):
        """
        The builder class for GRP (Gentoo Reference Platform) builds.
        """
@@ -39,7 +39,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)
+               StageBase.__init__(self,spec,addlargs)
 
        def set_target_path(self):
                self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
@@ -70,16 +70,15 @@ class grp_target(generic_stage_target):
                                        print_traceback=True)
 
        def set_use(self):
-               generic_stage_target.set_use(self)
-               if "BINDIST" in self.settings:
-                       if "use" in self.settings:
-                               self.settings["use"].append("bindist")
-                       else:
-                               self.settings["use"]=["bindist"]
+               StageBase.set_use(self)
+               if "use" in self.settings:
+                       self.settings["use"].append("bindist")
+               else:
+                       self.settings["use"]=["bindist"]
 
        def set_mounts(self):
-           self.mounts.append("/tmp/grp")
-            self.mountmap["/tmp/grp"]=self.settings["target_path"]
+               self.mounts.append("/tmp/grp")
+               self.mountmap["/tmp/grp"]=self.settings["target_path"]
 
        def generate_digests(self):
                for pkgset in self.settings["grp"]:
@@ -116,7 +115,7 @@ class grp_target(generic_stage_target):
                                                self.gen_digest_file(normpath(destdir+"/"+i))
 
        def set_action_sequence(self):
-           self.settings["action_sequence"]=["unpack","unpack_snapshot",\
+               self.settings["action_sequence"]=["unpack","unpack_snapshot",\
                                        "config_profile_link","setup_confdir","portage_overlay","bind","chroot_setup",\
                                        "setup_environment","run_local","unbind",\
                                        "generate_digests","clear_autoresume"]
index 9a53fd13f87a3f2a0153c6abd09b80a7c6df5a6c..30ba6054f1d74269d0238a0f6e20d81c6d39e8e7 100644 (file)
@@ -11,10 +11,10 @@ import string
 from catalyst.support import (normpath,
        touch, cmd)
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class livecd_stage1_target(generic_stage_target):
+class livecd_stage1_target(StageBase):
        """
        Builder class for LiveCD stage1.
        """
@@ -23,7 +23,7 @@ class livecd_stage1_target(generic_stage_target):
                self.valid_values=self.required_values[:]
 
                self.valid_values.extend(["livecd/use"])
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
 
        def set_action_sequence(self):
                self.settings["action_sequence"]=["unpack","unpack_snapshot",\
@@ -50,7 +50,7 @@ class livecd_stage1_target(generic_stage_target):
                        self.settings["spec_prefix"]="livecd"
 
        def set_use(self):
-               generic_stage_target.set_use(self)
+               StageBase.set_use(self)
                if "use" in self.settings:
                        self.settings["use"].append("livecd")
                        if "BINDIST" in self.settings:
@@ -61,7 +61,7 @@ class livecd_stage1_target(generic_stage_target):
                                self.settings["use"].append("bindist")
 
        def set_packages(self):
-               generic_stage_target.set_packages(self)
+               StageBase.set_packages(self)
                if self.settings["spec_prefix"]+"/packages" in self.settings:
                        if type(self.settings[self.settings["spec_prefix"]+"/packages"]) == types.StringType:
                                self.settings[self.settings["spec_prefix"]+"/packages"] = \
@@ -73,7 +73,7 @@ class livecd_stage1_target(generic_stage_target):
                        if type(self.settings["pkgcache_path"]) != types.StringType:
                                self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
                else:
-                       generic_stage_target.set_pkgcache_path(self)
+                       StageBase.set_pkgcache_path(self)
 
 def register(foo):
        foo.update({"livecd-stage1":livecd_stage1_target})
index ed398578657f5fc01dff67184712fcc39c28b481..c63c94cebd5430d3e51894acc7c2f8501e4a0c15 100644 (file)
@@ -8,10 +8,10 @@ import os
 
 from catalyst.support import (normpath, file_locate, CatalystError, cmd,
        read_from_clst, touch)
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class livecd_stage2_target(generic_stage_target):
+class livecd_stage2_target(StageBase):
        """
        Builder class for a LiveCD stage2 build.
        """
@@ -30,7 +30,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)
+               StageBase.__init__(self,spec,addlargs)
                if "livecd/type" not in self.settings:
                        self.settings["livecd/type"] = "generic-livecd"
 
index 4f02ae98b8c66bf10e15a248f11ec946acdf96df..ff7c0a9779c46829206927eaf9b50fbd2fa5c3bc 100644 (file)
@@ -12,10 +12,10 @@ from stat import ST_UID, ST_GID, ST_MODE
 from catalyst.support import (CatalystError, normpath,
        touch, cmd, list_bashify)
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class netboot2_target(generic_stage_target):
+class netboot2_target(StageBase):
        """
        Builder class for a netboot build, version 2
        """
@@ -46,7 +46,7 @@ class netboot2_target(generic_stage_target):
                except:
                        raise CatalystError("configuration error in netboot2/packages.")
 
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
                self.set_build_kernel_vars()
                self.settings["merge_path"]=normpath("/tmp/image/")
 
index b8ffae7162ce8f65ac2a8369af5bddd7a14a2605..eae35a9683d9ed61878bb3289f08f2533a475de7 100644 (file)
@@ -10,10 +10,10 @@ import types
 from catalyst.support import (CatalystError, normpath,
        cmd, list_bashify, file_locate)
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class netboot_target(generic_stage_target):
+class netboot_target(StageBase):
        """
        Builder class for a netboot build.
        """
@@ -42,7 +42,7 @@ class netboot_target(generic_stage_target):
                except:
                        raise CatalystError("configuration error in netboot/packages.")
 
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
                self.set_build_kernel_vars(addlargs)
                if "netboot/busybox_config" in addlargs:
                        file_locate(self.settings, ["netboot/busybox_config"])
index de5ab39e1f1fd46cc05c25ead69dc0814836976c..49d8e6d68d35eff5cfc5738c58ea4e10b34b6e90 100644 (file)
@@ -8,8 +8,8 @@ from stat import ST_UID, ST_GID, ST_MODE
 
 
 from catalyst.support import normpath, cmd
-from catalyst.targets.targetbase import TargetBase
-from catalyst.targets.genbase import GenBase
+from catalyst.base.targetbase import TargetBase
+from catalyst.base.genbase import GenBase
 
 class snapshot_target(TargetBase, GenBase):
        """
index 57d2b6aa8b3f0da3f452f9ff3052a63b2326a533..d70c5ec15986c00a5fd00828b546193a2635c9ad 100644 (file)
@@ -8,10 +8,10 @@ import os
 
 
 from catalyst.support import normpath, list_to_string
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class stage1_target(generic_stage_target):
+class stage1_target(StageBase):
        """
        Builder class for a stage1 installation tarball build.
        """
@@ -19,7 +19,7 @@ class stage1_target(generic_stage_target):
                self.required_values=[]
                self.valid_values=["chost"]
                self.valid_values.extend(["update_seed","update_seed_command"])
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
 
        def set_stage_path(self):
                self.settings["stage_path"]=normpath(self.settings["chroot_path"]+self.settings["root_path"])
@@ -31,11 +31,11 @@ class stage1_target(generic_stage_target):
                print "stage1 root path is "+self.settings["root_path"]
 
        def set_cleanables(self):
-               generic_stage_target.set_cleanables(self)
+               StageBase.set_cleanables(self)
                self.settings["cleanables"].extend([\
                "/usr/share/zoneinfo", "/etc/portage/package*"])
 
-       # XXX: How do these override_foo() functions differ from the ones in generic_stage_target and why aren't they in stage3_target?
+       # XXX: How do these override_foo() functions differ from the ones in StageBase and why aren't they in stage3_target?
 
        def override_chost(self):
                if "chost" in self.settings:
@@ -54,7 +54,7 @@ class stage1_target(generic_stage_target):
                        self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
 
        def set_portage_overlay(self):
-               generic_stage_target.set_portage_overlay(self)
+               StageBase.set_portage_overlay(self)
                if "portage_overlay" in self.settings:
                        print "\nWARNING !!!!!"
                        print "\tUsing an portage overlay for earlier stages could cause build issues."
index ad06935f4cff5a04e8620b9d0f6564cc65efe424..490bca714549ba979d4445975bd7b1f029748fc3 100644 (file)
@@ -7,17 +7,17 @@ import os
 
 
 from catalyst.support import normpath, list_to_string
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class stage2_target(generic_stage_target):
+class stage2_target(StageBase):
        """
        Builder class for a stage2 installation tarball build.
        """
        def __init__(self,spec,addlargs):
                self.required_values=[]
                self.valid_values=["chost"]
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
 
        def set_source_path(self):
                if "seedcache" in self.settings["options"] and os.path.isdir(normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/tmp/stage1root/")):
@@ -38,7 +38,7 @@ class stage2_target(generic_stage_target):
                        print "\tthe source path will then be "+normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2\n")
 
        # XXX: How do these override_foo() functions differ from the ones in
-       # generic_stage_target and why aren't they in stage3_target?
+       # StageBase and why aren't they in stage3_target?
 
        def override_chost(self):
                if "chost" in self.settings:
@@ -57,7 +57,7 @@ class stage2_target(generic_stage_target):
                        self.settings["LDFLAGS"]=list_to_string(self.settings["ldflags"])
 
        def set_portage_overlay(self):
-                       generic_stage_target.set_portage_overlay(self)
+                       StageBase.set_portage_overlay(self)
                        if "portage_overlay" in self.settings:
                                print "\nWARNING !!!!!"
                                print "\tUsing an portage overlay for earlier stages could cause build issues."
index 63b9ebc79168a7c0897bdf72ec1acf00323bfa95..be73a6c30cd7adbc60fc1415f7821511dd421c6d 100644 (file)
@@ -4,20 +4,20 @@ stage3 target, builds upon previous stage2/stage3 tarball
 # NOTE: That^^ docstring has influence catalyst-spec(5) man page generation.
 
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class stage3_target(generic_stage_target):
+class stage3_target(StageBase):
        """
        Builder class for a stage3 installation tarball build.
        """
        def __init__(self,spec,addlargs):
                self.required_values=[]
                self.valid_values=[]
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
 
        def set_portage_overlay(self):
-               generic_stage_target.set_portage_overlay(self)
+               StageBase.set_portage_overlay(self)
                if "portage_overlay" in self.settings:
                        print "\nWARNING !!!!!"
                        print "\tUsing an overlay for earlier stages could cause build issues."
@@ -25,7 +25,7 @@ class stage3_target(generic_stage_target):
                        print "\tDont say we did not warn you\n"
 
        def set_cleanables(self):
-               generic_stage_target.set_cleanables(self)
+               StageBase.set_cleanables(self)
 
 def register(foo):
        foo.update({"stage3":stage3_target})
index 9b48e6f95e2056b3314a2718466717c24106394c..bbdb048cbda67d1cefb72c2b1f9c6c339deb3333 100644 (file)
@@ -4,10 +4,10 @@ stage4 target, builds upon previous stage3/stage4 tarball
 # NOTE: That^^ docstring has influence catalyst-spec(5) man page generation.
 
 
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class stage4_target(generic_stage_target):
+class stage4_target(StageBase):
        """
        Builder class for stage4.
        """
@@ -19,7 +19,7 @@ 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)
+               StageBase.__init__(self,spec,addlargs)
 
        def set_cleanables(self):
                self.settings["cleanables"]=["/var/tmp/*","/tmp/*"]
index 4afc3ea0a0952f2c34c396ef802a8b1a680e4a58..c415d74473e1ee34572c28450f037ea8a16f0d39 100644 (file)
@@ -8,10 +8,10 @@ import os
 
 
 from catalyst.support import cmd, list_bashify, CatalystError
-from generic_stage_target import generic_stage_target
+from catalyst.base.stagebase import StageBase
 
 
-class tinderbox_target(generic_stage_target):
+class tinderbox_target(StageBase):
        """
        Builder class for the tinderbox target
        """
@@ -19,7 +19,7 @@ class tinderbox_target(generic_stage_target):
                self.required_values=["tinderbox/packages"]
                self.valid_values=self.required_values[:]
                self.valid_values.extend(["tinderbox/use"])
-               generic_stage_target.__init__(self,spec,addlargs)
+               StageBase.__init__(self,spec,addlargs)
 
        def run_local(self):
                # tinderbox