From 598d0eacd9666523f4dd47d5192c513b30eea374 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Sat, 10 Jan 2009 19:07:45 -0600 Subject: [PATCH] Remove hard-coded arch list now that find_arch_modules() is known to work --- ChangeLog | 4 ++++ modules/catalyst/arch/__init__.py | 31 +++++++------------------------ modules/catalyst/arch/arm.py | 1 + 3 files changed, 12 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 814316b7..3e2f6c58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS) # Distributed under the GPL v2 + 11 Jan 2009; Andrew Gaffney + modules/catalyst/arch/__init__.py, modules/catalyst/arch/arm.py: + Remove hard-coded arch list now that find_arch_modules() is known to work + 11 Jan 2009; Andrew Gaffney modules/catalyst/arch/__init__.py, modules/catalyst/arch/alpha.py, modules/catalyst/arch/amd64.py, modules/catalyst/arch/arm.py, diff --git a/modules/catalyst/arch/__init__.py b/modules/catalyst/arch/__init__.py index d907e25b..a46f6d8c 100644 --- a/modules/catalyst/arch/__init__.py +++ b/modules/catalyst/arch/__init__.py @@ -6,28 +6,13 @@ import os import imp import catalyst.util -# This hard-coded list of arch is here until I find a good way to get a list of -# other modules contained in the same dir as this file -__arch_module_list = ( - "alpha", - "amd64", - "arm", - "hppa", - "ia64", - "mips", - "powerpc", - "s390", - "sh", - "sparc", - "x86" -) +# This is only until we move all the output stuff into catalyst.output +from catalyst_support import msg class arches: - __arch_modules = None - def __init__(self): - self.__arch_modules = {} + self._arch_modules = {} def find_arch_modules(self): search_dir = os.path.abspath(os.path.dirname(__file__)) @@ -36,12 +21,10 @@ class arches: return arch_module_list def get_arches(self): - # We don't know if this works yet -# for x in self.find_arch_modules(): - for x in __arch_module_list: - self.__arch_modules[x] = catalyst.util.load_module("catalyst.arch." + x) - if self.__arch_modules[x] is None: + for x in self.find_arch_modules(): + self._arch_modules[x] = catalyst.util.load_module("catalyst.arch." + x) + if self._arch_modules[x] is None: msg("Cannot import catalyst.arch." + x + ". This usually only " + \ "happens due to a syntax error, which should be reported as " \ "a bug.") - return self.__arch_modules + return self._arch_modules diff --git a/modules/catalyst/arch/arm.py b/modules/catalyst/arch/arm.py index 0b47b517..55c7010e 100644 --- a/modules/catalyst/arch/arm.py +++ b/modules/catalyst/arch/arm.py @@ -44,6 +44,7 @@ class arch_armv5b(generic_arm): self.settings["CFLAGS"]+=" -mcpu=xscale" self.settings["CHOST"]="armv5b-unknown-linux-gnu" +__subarch_map = { "arm" : arch_arm, "armv4l" : arch_armv4l, "armeb" : arch_armeb, -- 2.26.2