print "Setting",x,"to default value \""+confdefaults[x]+"\""
conf_values[x]=confdefaults[x]
+ # add our python base directory to use for loading target arch's
+ conf_values["PythonDir"] = __selfpath__
+
# parse out the rest of the options from the config file
if "autoresume" in string.split(conf_values["options"]):
print "Autoresuming support enabled."
targetmap={}
try:
+ module_dir = __selfpath__ + "/modules/"
for x in required_build_targets:
try:
- fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
- module=imp.load_module(x,fh,"modules/"+x+".py",
- (".py","r",imp.PY_SOURCE))
+ fh=open(module_dir + x + ".py")
+ module=imp.load_module(x, fh,"modules/" + x + ".py",
+ (".py", "r", imp.PY_SOURCE))
fh.close()
except IOError:
- raise CatalystError,"Can't find "+x+".py plugin in "+\
- conf_values["sharedir"]+"/modules/"
-
+ raise CatalystError, "Can't find " + x + ".py plugin in " + \
+ module_dir
for x in valid_build_targets:
try:
- fh=open(conf_values["sharedir"]+"/modules/"+x+".py")
- module=imp.load_module(x,fh,"modules/"+x+".py",
- (".py","r",imp.PY_SOURCE))
+ fh=open(module_dir + x + ".py")
+ module=imp.load_module(x, fh, "modules/" + x + ".py",
+ (".py", "r", imp.PY_SOURCE))
module.register(targetmap)
fh.close()
except IOError:
- raise CatalystError,"Can't find "+x+".py plugin in "+\
- conf_values["sharedir"]+"/modules/"
+ raise CatalystError,"Can't find " + x + ".py plugin in " + \
+ module_dir
except ImportError:
print "!!! catalyst: Python modules not found in "+\
- conf_values["sharedir"]+"/modules; exiting."
+ module_dir + "; exiting."
sys.exit(1)
return targetmap
self.archmap = {}
self.subarchmap = {}
machinemap = {}
- for x in [x[:-3] for x in os.listdir(self.settings["sharedir"]+\
- "/arch/") if x.endswith(".py")]:
+ arch_dir = self.settings["PythonDir"] + "/arch/"
+ for x in [x[:-3] for x in os.listdir(arch_dir) if x.endswith(".py")]:
try:
- fh=open(self.settings["sharedir"]+"/arch/"+x+".py")
+ fh=open(arch_dir + x + ".py")
"""
This next line loads the plugin as a module and assigns it to
archmap[x]
"""
- self.archmap[x]=imp.load_module(x,fh,"arch/"+x+\
- ".py",(".py","r",imp.PY_SOURCE))
+ self.archmap[x]=imp.load_module(x,fh,"../arch/" + x + ".py",
+ (".py", "r", imp.PY_SOURCE))
"""
This next line registers all the subarches supported in the
plugin
the dir should load just fine. If it doesn't, it's probably a
syntax error in the module
"""
- msg("Can't find/load "+x+".py plugin in "+\
- self.settings["sharedir"]+"/arch/")
+ msg("Can't find/load " + x + ".py plugin in " + arch_dir)
if "chost" in self.settings:
hostmachine = self.settings["chost"].split("-")[0]