Remove hard-coded arch list now that find_arch_modules() is known to work
authorAndrew Gaffney <agaffney@gentoo.org>
Sun, 11 Jan 2009 01:07:45 +0000 (19:07 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Sun, 11 Jan 2009 01:07:45 +0000 (19:07 -0600)
ChangeLog
modules/catalyst/arch/__init__.py
modules/catalyst/arch/arm.py

index 814316b719db5d59d36b7918c5cc2fe72113b9cb..3e2f6c58a793d2b83d46e1d2c3edffa1c9a171d5 100644 (file)
--- 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 <agaffney@gentoo.org>
+  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 <agaffney@gentoo.org>
   modules/catalyst/arch/__init__.py, modules/catalyst/arch/alpha.py,
   modules/catalyst/arch/amd64.py, modules/catalyst/arch/arm.py,
index d907e25b952073301dd180dc12619066cc30eff7..a46f6d8c5326f922a633adac76ba1dce72c51d36 100644 (file)
@@ -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
index 0b47b51755ee218d612b5fa876eac2e1da0417ac..55c7010eecd32418b9ce0cf8725f9413f866b195 100644 (file)
@@ -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,