# Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
# Distributed under the GPL v2
+ 11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org> catalyst,
+ modules/catalyst/target/__init__.py,
+ modules/catalyst/target/generic_stage_target.py:
+ Move target module loading logic into build_target_map() in
+ catalyst.target module
+
11 Jan 2009; Andrew Gaffney <agaffney@gentoo.org> catalyst,
modules/catalyst/target/embedded_target.py,
modules/catalyst/target/grp_target.py,
def import_modules():
# import catalyst's own modules (i.e. catalyst_support and the arch modules)
- targetmap={}
-
- targets = catalyst.target.targets()
- for x in targets.get_targets():
- targetmap.update(x.__target_map)
+ import catalyst.target
+ targetmap = catalyst.target.build_target_map()
return targetmap
def build_target(addlargs, targetmap):
# import configuration file and import our main module using those settings
parse_config(myconfig)
- sys.path.append(conf_values["sharedir"]+"/modules")
+
from catalyst_support import *
# Start checking that digests are valid now that the hash_map was imported from catalyst_support
"happens due to a syntax error, which should be reported as " \
"a bug.")
return self._target_modules
+
+def build_target_map():
+ target_map = {}
+ targets_obj = targets()
+ target_modules = targets_obj.get_targets()
+ for x in target_modules:
+ if hasattr(target_modules[x], '__target_map'):
+ target_map.update(target_modules[x].__target_map)
+ return target_map
previously. -agaffney
"""
- self.archmap = {}
self.subarchmap = {}
machinemap = {}
+
arches = catalyst.arch.arches()
+ arch_modules = arches.get_arches()
for x in arches.get_arches():
- tmpsubarchmap, tmpmachinemap = self.archmap[x].register()
- self.subarchmap.update(x.__subarch_map)
- for machine in x.__machine_map:
- machinemap[machine] = x
- for subarch in x.__subarch_map:
- machinemap[subarch] = x
+ self.subarchmap.update(arch_modules[x].__subarch_map)
+ for machine in arch_modules[x].__machine_map:
+ machinemap[machine] = arch_modules[x]
+ for subarch in arch_modules[x].__subarch_map:
+ machinemap[subarch] = arch_modules[x]
if self.settings.has_key("chost"):
hostmachine = self.settings["chost"].split("-")[0]