4 # NOTE: That^^ docstring has influence catalyst-spec(5) man page generation.
6 from catalyst_support import *
7 from generic_stage_target import *
9 class livecd_stage1_target(generic_stage_target):
11 Builder class for LiveCD stage1.
13 def __init__(self,spec,addlargs):
14 self.required_values=["livecd/packages"]
15 self.valid_values=self.required_values[:]
17 self.valid_values.extend(["livecd/use"])
18 generic_stage_target.__init__(self,spec,addlargs)
20 def set_action_sequence(self):
21 self.settings["action_sequence"]=["unpack","unpack_snapshot",\
22 "config_profile_link","setup_confdir","portage_overlay",\
23 "bind","chroot_setup","setup_environment","build_packages",\
24 "unbind", "clean","clear_autoresume"]
26 def set_target_path(self):
27 self.settings["target_path"]=normpath(self.settings["storedir"]+"/builds/"+self.settings["target_subpath"])
28 if "AUTORESUME" in self.settings \
29 and os.path.exists(self.settings["autoresume_path"]+"setup_target_path"):
30 print "Resume point detected, skipping target path setup operation..."
32 # first clean up any existing target stuff
33 if os.path.exists(self.settings["target_path"]):
34 cmd("rm -rf "+self.settings["target_path"],\
35 "Could not remove existing directory: "+self.settings["target_path"],env=self.env)
36 touch(self.settings["autoresume_path"]+"setup_target_path")
38 if not os.path.exists(self.settings["target_path"]):
39 os.makedirs(self.settings["target_path"])
41 def set_target_path(self):
44 def set_spec_prefix(self):
45 self.settings["spec_prefix"]="livecd"
48 generic_stage_target.set_use(self)
49 if "use" in self.settings:
50 self.settings["use"].append("livecd")
51 if "BINDIST" in self.settings:
52 self.settings["use"].append("bindist")
54 self.settings["use"]=["livecd"]
55 if "BINDIST" in self.settings:
56 self.settings["use"].append("bindist")
58 def set_packages(self):
59 generic_stage_target.set_packages(self)
60 if self.settings["spec_prefix"]+"/packages" in self.settings:
61 if type(self.settings[self.settings["spec_prefix"]+"/packages"]) == types.StringType:
62 self.settings[self.settings["spec_prefix"]+"/packages"] = \
63 self.settings[self.settings["spec_prefix"]+"/packages"].split()
64 self.settings[self.settings["spec_prefix"]+"/packages"].append("app-misc/livecd-tools")
66 def set_pkgcache_path(self):
67 if "pkgcache_path" in self.settings:
68 if type(self.settings["pkgcache_path"]) != types.StringType:
69 self.settings["pkgcache_path"]=normpath(string.join(self.settings["pkgcache_path"]))
71 generic_stage_target.set_pkgcache_path(self)
74 foo.update({"livecd-stage1":livecd_stage1_target})