3 import os,sys,imp,string
5 #This allows plugins (and this code) to import modules in the /modules dir
6 sys.path.append(os.getcwd()+"/modules")
8 from catalyst_support import *
13 if len(sys.argv)==1 or sys.argv[1] in ["-h","--help"]:
19 targets.register(targetmap)
22 #non-root callers can't go any further than here.
23 die("This script requires root privileges to operate.")
26 #these would come from /etc/catalyst.conf:
27 myspec["storedir"]="/var/tmp/catalyst"
28 myspec["sharedir"]="/usr/share/catalyst"
29 #these would come from there too?:
30 myspec["distdir"]="/mnt/misc/distfiles"
31 myspec["portdir"]="/usr/portage"
32 myspec["options"]="ccache pkgcache"
33 if "ccache" in string.split(myspec["options"]):
34 print "Compiler cache support enabled."
36 if "pkgcache" in string.split(myspec["options"]):
37 print "Package cache support enabled."
38 myspec["PKGCACHE"]="1"
39 #determine target, call target constructor and hand it the rest of the arguments
43 arg_parse(myspec,addlargs)
44 if not targetmap.has_key(myspec["target"]):
45 raise CatalystError,"Target \""+myspec["target"]+"\" not available."
46 mytarget=targetmap[myspec["target"]](myspec,addlargs)
52 # ./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
53 # ./catalyst target=snapshot version_stamp=20031028