Make use of set_autoresume() in target modules
authorAndrew Gaffney <agaffney@gentoo.org>
Mon, 12 Jan 2009 04:59:33 +0000 (22:59 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Mon, 12 Jan 2009 04:59:33 +0000 (22:59 -0600)
ChangeLog
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

index c47e04485903716ec79ce2b7ad28e9ead8d021ef..ad3a0074e50aa17d0a39c9dec05edba123bbc274 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,13 @@
 # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
 # Distributed under the GPL v2
 
+  12 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+  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:
+  Make use of set_autoresume() in target modules
+
   12 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
   modules/catalyst/target/generic.py,
   modules/catalyst/target/generic_stage.py, modules/catalyst/target/grp.py,
index 5fdef322e7a935aa509d3d33c0a3acaf518b40b1..a531c9e172782fb74602350d0faa3c337c86d760 100644 (file)
@@ -789,7 +789,7 @@ class generic_stage_target(generic_target):
                                self.settings["target_profile"]+" "+\
                                self.settings["chroot_path"]+"/etc/make.profile",\
                                "Error creating profile link",env=self.env)
-                       catalyst.util.touch(self.settings["autoresume_path"]+"config_profile_link")
+                       self.set_autoresume("config_profile_link")
 
        def setup_confdir(self):
                if self.check_autoresume("setup_confdir"):
@@ -802,7 +802,7 @@ class generic_stage_target(generic_target):
                                cmd("cp -R "+self.settings["portage_confdir"]+"/ "+\
                                        self.settings["chroot_path"]+"/etc/portage",\
                                        "Error copying /etc/portage",env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"setup_confdir")
+                               self.set_autoresume("setup_confdir")
 
        def portage_overlay(self):
                """ We copy the contents of our overlays to /usr/local/portage """
@@ -1012,7 +1012,7 @@ class generic_stage_target(generic_target):
                        cmd("cp "+self.settings["chroot_path"]+"/etc/make.conf "+\
                                self.settings["chroot_path"]+"/etc/make.conf.catalyst",\
                                "Could not backup /etc/make.conf",env=self.env)
-                       catalyst.util.touch(self.settings["autoresume_path"]+"chroot_setup")
+                       self.set_autoresume("chroot_setup")
 
        def fsscript(self):
                if self.check_autoresume("fsscript"):
@@ -1022,7 +1022,7 @@ class generic_stage_target(generic_target):
                                if os.path.exists(self.settings["controller_file"]):
                                        cmd("/bin/bash "+self.settings["controller_file"]+\
                                                " fsscript","fsscript script failed.",env=self.env)
-                                       catalyst.util.touch(self.settings["autoresume_path"]+"fsscript")
+                                       self.set_autoresume("fsscript")
 
        def rcupdate(self):
                if self.check_autoresume("rcupdate"):
@@ -1031,7 +1031,7 @@ class generic_stage_target(generic_target):
                        if os.path.exists(self.settings["controller_file"]):
                                cmd("/bin/bash "+self.settings["controller_file"]+" rc-update",\
                                        "rc-update script failed.",env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"rcupdate")
+                               self.set_autoresume("rcupdate")
 
        def clean(self):
                if self.check_autoresume("clean"):
@@ -1065,7 +1065,7 @@ class generic_stage_target(generic_target):
                if os.path.exists(self.settings["controller_file"]):
                        cmd("/bin/bash "+self.settings["controller_file"]+" clean",\
                                "clean script failed.",env=self.env)
-                       catalyst.util.touch(self.settings["autoresume_path"]+"clean")
+                       self.set_autoresume("clean")
 
        def empty(self):
                if self.check_autoresume("empty"):
@@ -1092,7 +1092,7 @@ class generic_stage_target(generic_target):
                                        os.makedirs(myemp,0755)
                                        os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
                                        os.chmod(myemp,mystat[ST_MODE])
-                       catalyst.util.touch(self.settings["autoresume_path"]+"empty")
+                       self.set_autoresume("empty")
 
        def remove(self):
                if self.check_autoresume("remove"):
@@ -1110,7 +1110,7 @@ class generic_stage_target(generic_target):
                                        if os.path.exists(self.settings["controller_file"]):
                                                cmd("/bin/bash "+self.settings["controller_file"]+\
                                                        " clean","Clean  failed.",env=self.env)
-                                               catalyst.util.touch(self.settings["autoresume_path"]+"remove")
+                                               self.set_autoresume("remove")
                                except:
                                        self.unbind()
                                        raise
@@ -1123,7 +1123,7 @@ class generic_stage_target(generic_target):
                                if os.path.exists(self.settings["controller_file"]):
                                        cmd("/bin/bash "+self.settings["controller_file"]+\
                                                " preclean","preclean script failed.",env=self.env)
-                                       catalyst.util.touch(self.settings["autoresume_path"]+"preclean")
+                                       self.set_autoresume("preclean")
 
                        except:
                                self.unbind()
@@ -1151,7 +1151,7 @@ class generic_stage_target(generic_target):
                        catalyst.hash.gen_contents_file(self.settings["target_path"], self.settings)
                        catalyst.hash.gen_digest_file(self.settings["target_path"], self.settings)
 
-                       catalyst.util.touch(self.settings["autoresume_path"]+"capture")
+                       self.set_autoresume("capture")
 
        def run_local(self):
                if self.check_autoresume("run_local"):
@@ -1161,7 +1161,7 @@ class generic_stage_target(generic_target):
                                if os.path.exists(self.settings["controller_file"]):
                                        cmd("/bin/bash "+self.settings["controller_file"]+" run",\
                                                "run script failed.",env=self.env)
-                                       catalyst.util.touch(self.settings["autoresume_path"]+"run_local")
+                                       self.set_autoresume("run_local")
 
                        except CatalystError:
                                self.unbind()
@@ -1252,7 +1252,7 @@ class generic_stage_target(generic_target):
                                except CatalystError:
                                        self.unbind()
                                        raise
-                               catalyst.util.touch(self.settings["autoresume_path"]+"unmerge")
+                               self.set_autoresume("unmerge")
 
        def target_setup(self):
                if self.check_autoresume("target_setup"):
@@ -1262,7 +1262,7 @@ class generic_stage_target(generic_target):
                        cmd("/bin/bash "+self.settings["controller_file"]+\
                                " target_image_setup "+ self.settings["target_path"],\
                                "target_image_setup script failed.",env=self.env)
-                       catalyst.util.touch(self.settings["autoresume_path"]+"target_setup")
+                       self.set_autoresume("target_setup")
 
        def setup_overlay(self):
                if self.check_autoresume("setup_overlay"):
@@ -1275,7 +1275,7 @@ class generic_stage_target(generic_target):
                                                        self.settings["target_path"],\
                                                        self.settings["spec_prefix"]+"overlay: "+x+\
                                                        " copy failed.",env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"setup_overlay")
+                               self.set_autoresume("setup_overlay")
 
        def create_iso(self):
                if self.check_autoresume("create_iso"):
@@ -1288,7 +1288,7 @@ class generic_stage_target(generic_target):
                                        env=self.env)
                                catalyst.hash.gen_contents_file(self.settings["iso"], self.settings)
                                catalyst.hash.gen_digest_file(self.settings["iso"], self.settings)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"create_iso")
+                               self.set_autoresume("create_iso")
                        else:
                                print "WARNING: livecd/iso was not defined."
                                print "An ISO Image will not be created."
@@ -1305,7 +1305,7 @@ class generic_stage_target(generic_target):
                                        cmd("/bin/bash "+self.settings["controller_file"]+\
                                                " build_packages "+mypack,\
                                                "Error in attempt to build packages",env=self.env)
-                                       catalyst.util.touch(self.settings["autoresume_path"]+"build_packages")
+                                       self.set_autoresume("build_packages")
                                except CatalystError:
                                        self.unbind()
                                        raise CatalystError,self.settings["spec_prefix"]+\
@@ -1414,8 +1414,7 @@ class generic_stage_target(generic_target):
                                                                        cmd("rm -R "+self.settings["chroot_path"]+\
                                                                                "/tmp/initramfs_overlay/",env=self.env)
 
-                                                       catalyst.util.touch(self.settings["autoresume_path"]+\
-                                                               "build_kernel_"+kname)
+                                                       self.set_autoresume("build_kernel_" + kname)
 
                                                        """
                                                        Execute the script that cleans up the kernel build
@@ -1425,7 +1424,7 @@ class generic_stage_target(generic_target):
                                                                " post-kmerge ",
                                                                "Runscript post-kmerge failed",env=self.env)
 
-                                       catalyst.util.touch(self.settings["autoresume_path"]+"build_kernel")
+                                       self.set_autoresume("build_kernel")
 
                                except CatalystError:
                                        self.unbind()
@@ -1440,7 +1439,7 @@ class generic_stage_target(generic_target):
                                cmd("/bin/bash "+self.settings["controller_file"]+\
                                        " bootloader " + self.settings["target_path"],\
                                        "Bootloader script failed.",env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"bootloader")
+                               self.set_autoresume("bootloader")
                        except CatalystError:
                                self.unbind()
                                raise CatalystError,"Script aborting due to error."
@@ -1452,7 +1451,7 @@ class generic_stage_target(generic_target):
                        try:
                                cmd("/bin/bash "+self.settings["controller_file"]+\
                                        " livecd-update","livecd-update failed.",env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"livecd_update")
+                               self.set_autoresume("livecd_update")
 
                        except CatalystError:
                                self.unbind()
index 823795ccce47502bfedde074b83730fe28dc1841..263ce39f4d845342f48847bde83e600105b22b2e 100644 (file)
@@ -45,7 +45,7 @@ class grp_target(generic_stage_target):
                        if not os.path.exists(self.settings["target_path"]):
                                os.makedirs(self.settings["target_path"])
 
-                       catalyst.util.touch(self.settings["autoresume_path"]+"setup_target_path")
+                       self.set_autoresume("setup_target_path")
 
        def run_local(self):
                for pkgset in self.settings["grp"]:
index 17006d881546999d676e068885c45ef4db3d552a..a01622810b3415de9bde2d3a4ea3c12d5f83d9a6 100644 (file)
@@ -30,7 +30,7 @@ class livecd_stage1_target(generic_stage_target):
                        if os.path.exists(self.settings["target_path"]):
                                cmd("rm -rf "+self.settings["target_path"],\
                                        "Could not remove existing directory: "+self.settings["target_path"],env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"setup_target_path")
+                               self.set_autoresume("setup_target_path")
 
                        if not os.path.exists(self.settings["target_path"]):
                                os.makedirs(self.settings["target_path"])
index d25bd23c9c59afab926ec2f5602aa9b3743d1693..f9cad328d59db3cb11d6841e5aa99eee5a9ccd2d 100644 (file)
@@ -52,7 +52,7 @@ class livecd_stage2_target(generic_stage_target):
                        if os.path.isdir(self.settings["target_path"]):
                                cmd("rm -rf "+self.settings["target_path"],
                                "Could not remove existing directory: "+self.settings["target_path"],env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"setup_target_path")
+                               self.set_autoresume("setup_target_path")
                        if not os.path.exists(self.settings["target_path"]):
                                os.makedirs(self.settings["target_path"])
 
@@ -122,7 +122,7 @@ class livecd_stage2_target(generic_stage_target):
                                myf.write(self.settings["source_path_hash"])
                                myf.close()
                        else:
-                               catalyst.util.touch(self.settings["autoresume_path"]+"unpack")
+                               self.set_autoresume("unpack")
 
        def set_action_sequence(self):
                self.settings["action_sequence"]=["unpack","unpack_snapshot",\
index 269a4b9eb9d1ff1d32a2317debe33ac85c280162..140a624905e86cc707bdd12fee64cb78eab05b61 100644 (file)
@@ -51,7 +51,7 @@ class netboot_target(generic_stage_target):
                        if os.path.isfile(self.settings["target_path"]):
                                cmd("rm -f "+self.settings["target_path"], \
                                        "Could not remove existing file: "+self.settings["target_path"],env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"setup_target_path")
+                               self.set_autoresume("setup_target_path")
 
                if not os.path.exists(self.settings["storedir"]+"/builds/"):
                        os.makedirs(self.settings["storedir"]+"/builds/")
@@ -90,7 +90,7 @@ class netboot_target(generic_stage_target):
                                self.unbind()
                                raise CatalystError,"Failed to copy files to image!"
 
-                       catalyst.util.touch(self.settings["autoresume_path"]+"copy_files_to_image")
+                       self.set_autoresume("copy_files_to_image")
 
        def setup_overlay(self):
                if self.check_autoresume("setup_overlay"):
@@ -101,7 +101,7 @@ class netboot_target(generic_stage_target):
                                        if os.path.exists(x):
                                                cmd("rsync -a "+x+"/ "+\
                                                        self.settings["chroot_path"] + self.settings["merge_path"], "netboot/overlay: "+x+" copy failed.",env=self.env)
-                               catalyst.util.touch(self.settings["autoresume_path"]+"setup_overlay")
+                               self.set_autoresume("setup_overlay")
 
        def move_kernels(self):
                # we're done, move the kernels to builds/*
@@ -146,7 +146,7 @@ class netboot_target(generic_stage_target):
                                        os.makedirs(myemp,0755)
                                        os.chown(myemp,mystat[ST_UID],mystat[ST_GID])
                                        os.chmod(myemp,mystat[ST_MODE])
-               catalyst.util.touch(self.settings["autoresume_path"]+"empty")
+               self.set_autoresume("empty")
 
        def set_action_sequence(self):
            self.settings["action_sequence"]=["unpack","unpack_snapshot","config_profile_link",