3 import os,sys,imp,string
8 if len(sys.argv)==1 or sys.argv[1] in ["-h","--help"]:
14 targets.register(targetmap)
17 #non-root callers can't go any further than here.
18 die("This script requires root privileges to operate.")
22 if os.path.exists("/etc/catalyst.conf"):
24 execfile("/etc/catalyst.conf",myconf,myconf)
26 print "catalyst: Unable to /etc/catalyst.conf config file (syntax error)"
29 confdefaults={ "storedir":"/var/tmp/catalyst","sharedir":"/usr/share/catalyst","distdir":"/usr/portage/distfiles",
30 "portdir":"/usr/portage","options":"ccache"}
32 for x in confdefaults.keys():
34 print "Setting",x,"to config file value \""+myconf[x]+"\""
37 print "Setting",x,"to default value \""+confdefaults[x]+"\""
38 myspec[x]=confdefaults[x]
40 #This allows plugins (and this code) to import modules in the /modules dir
41 sys.path.append(myspec["sharedir"]+"/modules")
43 from catalyst_support import *
45 print "catalyst: catalyst_support module not found in "+myspec["sharedir"]+"/modules; exiting."
48 if "ccache" in string.split(myspec["options"]):
49 print "Compiler cache support enabled."
51 if "pkgcache" in string.split(myspec["options"]):
52 print "Package cache support enabled."
53 myspec["PKGCACHE"]="1"
54 #determine target, call target constructor and hand it the rest of the arguments
58 arg_parse(myspec,addlargs)
59 if not targetmap.has_key(myspec["target"]):
60 raise CatalystError,"Target \""+myspec["target"]+"\" not available."
61 mytarget=targetmap[myspec["target"]](myspec,addlargs)
67 # ./catalyst subarch=pentium4 version_stamp=20031016 target=stage3 rel_type=default rel_version=1.4 snapshot=20031016 source_subpath=default-x86-1.4/stage2-pentium4-20031016
68 # ./catalyst target=snapshot version_stamp=20031028