msg("Resume point detected, skipping fsscript operation...")
else:
if "fsscript" in self.settings:
- if os.path.exists(self.settings["controller_file"]):
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " fsscript","fsscript script failed.",env=self.env)
- self.set_autoresume("fsscript")
+ self.run_controller_action("fsscript")
+ self.set_autoresume("fsscript")
def rcupdate(self):
if self.check_autoresume("rcupdate"):
msg("Resume point detected, skipping rcupdate operation...")
else:
- if os.path.exists(self.settings["controller_file"]):
- cmd("/bin/bash "+self.settings["controller_file"]+" rc-update",\
- "rc-update script failed.",env=self.env)
- self.set_autoresume("rcupdate")
+ self.run_controller_action("rc-update")
+ self.set_autoresume("rcupdate")
def clean(self):
if self.check_autoresume("clean"):
"/etc -maxdepth 1 -name \"*-\" | xargs rm -f",\
"Could not remove stray files in /etc",env=self.env)
- if os.path.exists(self.settings["controller_file"]):
- cmd("/bin/bash "+self.settings["controller_file"]+" clean",\
- "clean script failed.",env=self.env)
- self.set_autoresume("clean")
+ self.run_controller_action("clean")
+ self.set_autoresume("clean")
def empty(self):
if self.check_autoresume("empty"):
msg("livecd: removing " + x)
os.system("rm -rf "+self.settings["chroot_path"]+x)
try:
- if os.path.exists(self.settings["controller_file"]):
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " clean","Clean failed.",env=self.env)
- self.set_autoresume("remove")
+ self.run_controller_action("clean")
+ self.set_autoresume("remove")
except:
self.unbind()
raise
msg("Resume point detected, skipping preclean operation...")
else:
try:
- if os.path.exists(self.settings["controller_file"]):
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " preclean","preclean script failed.",env=self.env)
- self.set_autoresume("preclean")
+ self.run_controller_action("preclean")
+ self.set_autoresume("preclean")
except:
self.unbind()
msg("Resume point detected, skipping run_local operation...")
else:
try:
- if os.path.exists(self.settings["controller_file"]):
- cmd("/bin/bash "+self.settings["controller_file"]+" run",\
- "run script failed.",env=self.env)
- self.set_autoresume("run_local")
+ self.run_controller_action("run")
+ self.set_autoresume("run_local")
except CatalystError:
self.unbind()
""" Before cleaning, unmerge stuff """
try:
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " unmerge "+ myunmerge,"Unmerge script failed.",\
- env=self.env)
+ self.run_controller_action("unmerge")
msg("unmerge shell script")
except CatalystError:
self.unbind()
msg("Resume point detected, skipping target_setup operation...")
else:
msg("Setting up filesystems per filesystem type")
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " target_image_setup "+ self.settings["target_path"],\
- "target_image_setup script failed.",env=self.env)
+ self.run_controller_action("target_image_setup")
self.set_autoresume("target_setup")
def setup_overlay(self):
else:
""" Create the ISO """
if "iso" in self.settings:
- cmd("/bin/bash "+self.settings["controller_file"]+" iso "+\
- self.settings["iso"],"ISO creation script failed.",\
- env=self.env)
+ self.run_controller_action("iso", self.settings["iso"])
catalyst.hash.gen_contents_file(self.settings["iso"], self.settings)
catalyst.hash.gen_digest_file(self.settings["iso"], self.settings)
self.set_autoresume("create_iso")
mypack = \
catalyst.util.list_bashify(self.settings["packages"])
try:
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " build_packages "+mypack,\
- "Error in attempt to build packages",env=self.env)
+ self.run_controller_action("build_packages", mypack)
self.set_autoresume("build_packages")
except CatalystError:
self.unbind()
"""
Execute the script that sets up the kernel build environment
"""
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " pre-kmerge ","Runscript pre-kmerge failed",\
- env=self.env)
+ self.run_controller_action("pre-kmerge")
for kname in mynames:
if self.check_autoresume("build_kernel_" + kname):
"/initramfs_overlay"],env=self.env)
""" Execute the script that builds the kernel """
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " kernel "+kname,\
- "Runscript kernel build failed",env=self.env)
+ self.run_controller_action("kernel", kname)
if self.settings.has_key("boot/kernel/"+kname+\
"/initramfs_overlay"):
Execute the script that cleans up the kernel build
environment
"""
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " post-kmerge ",
- "Runscript post-kmerge failed",env=self.env)
+ self.run_controller_action("post-kmerge")
self.set_autoresume("build_kernel")
msg("Resume point detected, skipping bootloader operation...")
else:
try:
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " bootloader " + self.settings["target_path"],\
- "Bootloader script failed.",env=self.env)
+ self.run_controller_action("bootloader", self.settings["target_path"])
self.set_autoresume("bootloader")
except CatalystError:
self.unbind()
msg("Resume point detected, skipping build_packages operation...")
else:
try:
- cmd("/bin/bash "+self.settings["controller_file"]+\
- " livecd-update","livecd-update failed.",env=self.env)
- self.set_autoresume("livecd_update")
+ self.run_controller_action("livecd-update")
except CatalystError:
self.unbind()
class grp_target(generic_stage_target):
def __init__(self):
+ generic_stage_target.__init__(self)
+
self.required_values=["version_stamp","target","subarch",\
"rel_type","profile","snapshot","source_subpath"]
self.valid_values=self.required_values[:]
self.valid_values.extend(["grp/use"])
- if not "grp" in addlargs:
+ if not "grp" in self.settings:
raise CatalystError,"Required value \"grp\" not specified in spec."
self.required_values.extend(["grp"])
- if type(addlargs["grp"])==types.StringType:
- addlargs["grp"]=[addlargs["grp"]]
+ if type(self.settings["grp"])==types.StringType:
+ self.settings["grp"]=[self.settings["grp"]]
- if "grp/use" in addlargs:
- if type(addlargs["grp/use"])==types.StringType:
- addlargs["grp/use"]=[addlargs["grp/use"]]
+ if "grp/use" in self.settings:
+ if type(self.settings["grp/use"])==types.StringType:
+ self.settings["grp/use"]=[self.settings["grp/use"]]
- for x in addlargs["grp"]:
+ for x in self.settings["grp"]:
self.required_values.append("grp/"+x+"/packages")
self.required_values.append("grp/"+x+"/type")
- 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"]+"/")
if self.check_autoresume("setup_target_path"):
def run_local(self):
for pkgset in self.settings["grp"]:
# example call: "grp.sh run pkgset cd1 xmms vim sys-apps/gleep"
- mypackages = catalyst.util.list_bashify(self.settings["grp/"+pkgset+"/packages"])
+ mypackages = catalyst.util.list_bashify(self.settings[pkgset + "/packages"])
try:
- cmd("/bin/bash "+self.settings["controller_file"]+" run "+self.settings["grp/"+pkgset+"/type"]\
- +" "+pkgset+" "+mypackages,env=self.env)
+ self.run_controller_action("run", self.settings[pkgset + "/type"] + " " + pkgset)
except CatalystError:
self.unbind()