"""
def __init__(self,spec,addlargs):
self.required_values=["boot/kernel"]
-
+
self.valid_values=[]
-
+
self.valid_values.extend(self.required_values)
self.valid_values.extend(["livecd/cdtar","livecd/empty","livecd/rm",\
"livecd/unmerge","livecd/iso","livecd/gk_mainargs","livecd/type",\
"livecd/root_overlay","livecd/users","portage_overlay",\
"livecd/fstype","livecd/fsops","livecd/linuxrc","livecd/bootargs",\
"gamecd/conf","livecd/xdm","livecd/xsession","livecd/volid"])
-
+
generic_stage_target.__init__(self,spec,addlargs)
- if not self.settings.has_key("livecd/type"):
+ if "livecd/type" not in self.settings:
self.settings["livecd/type"] = "generic-livecd"
file_locate(self.settings, ["cdtar","controller_file"])
-
+
def set_source_path(self):
self.settings["source_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["source_subpath"]+".tar.bz2")
if os.path.isfile(self.settings["source_path"]):
self.settings["source_path"]=normpath(self.settings["storedir"]+"/tmp/"+self.settings["source_subpath"]+"/")
if not os.path.exists(self.settings["source_path"]):
raise CatalystError,"Source Path: "+self.settings["source_path"]+" does not exist."
-
+
def set_spec_prefix(self):
self.settings["spec_prefix"]="livecd"
def set_target_path(self):
self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"]+"/")
- if self.settings.has_key("AUTORESUME") \
+ if "AUTORESUME" in self.settings \
and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
print "Resume point detected, skipping target path setup operation..."
else:
def run_local(self):
# what modules do we want to blacklist?
- if self.settings.has_key("livecd/modblacklist"):
+ if "livecd/modblacklist" in self.settings:
try:
myf=open(self.settings["chroot_path"]+"/etc/modprobe.d/blacklist.conf","a")
except:
self.unbind()
raise CatalystError,"Couldn't open "+self.settings["chroot_path"]+"/etc/modprobe.d/blacklist.conf."
-
+
myf.write("\n#Added by Catalyst:")
+ # workaround until config.py is using configparser
+ if isinstance(self.settings["livecd/modblacklist"], str):
+ self.settings["livecd/modblacklist"] = self.settings["livecd/modblacklist"].split()
for x in self.settings["livecd/modblacklist"]:
myf.write("\nblacklist "+x)
myf.close()
-
+
def unpack(self):
unpack=True
display_msg=None
error_msg="Rsync of "+self.settings["source_path"]+" to "+self.settings["chroot_path"]+" failed."
invalid_snapshot=False
- if self.settings.has_key("AUTORESUME"):
+ if "AUTORESUME" in self.settings:
if os.path.isdir(self.settings["source_path"]) and \
os.path.exists(self.settings["autoresume_path"]+"unpack"):
print "Resume point detected, skipping unpack operation..."
unpack=False
- elif self.settings.has_key("source_path_hash"):
+ elif "source_path_hash" in self.settings:
if self.settings["source_path_hash"] != clst_unpack_hash:
invalid_snapshot=True
if not os.path.exists(self.settings["chroot_path"]+"/tmp"):
os.makedirs(self.settings["chroot_path"]+"/tmp",1777)
- if self.settings.has_key("PKGCACHE"):
+ if "PKGCACHE" in self.settings:
if not os.path.exists(self.settings["pkgcache_path"]):
os.makedirs(self.settings["pkgcache_path"],0755)
print display_msg
cmd(unpack_cmd,error_msg,env=self.env)
- if self.settings.has_key("source_path_hash"):
+ if "source_path_hash" in self.settings:
myf=open(self.settings["autoresume_path"]+"unpack","w")
myf.write(self.settings["source_path_hash"])
myf.close()
"config_profile_link","setup_confdir","portage_overlay",\
"bind","chroot_setup","setup_environment","run_local",\
"build_kernel"]
- if not self.settings.has_key("FETCH"):
+ if "FETCH" not in self.settings:
self.settings["action_sequence"] += ["bootloader","preclean",\
"livecd_update","root_overlay","fsscript","rcupdate","unmerge",\
"unbind","remove","empty","target_setup",\