Fix up a few runtime errors
authorAndrew Gaffney <agaffney@gentoo.org>
Wed, 14 Jan 2009 02:11:30 +0000 (20:11 -0600)
committerAndrew Gaffney <agaffney@gentoo.org>
Wed, 14 Jan 2009 02:11:30 +0000 (20:11 -0600)
15 files changed:
ChangeLog
modules/catalyst/arch/alpha.py
modules/catalyst/arch/amd64.py
modules/catalyst/arch/arm.py
modules/catalyst/arch/hppa.py
modules/catalyst/arch/ia64.py
modules/catalyst/arch/mips.py
modules/catalyst/arch/powerpc.py
modules/catalyst/arch/s390.py
modules/catalyst/arch/sh.py
modules/catalyst/arch/sparc.py
modules/catalyst/arch/x86.py
modules/catalyst/lock.py
modules/catalyst/target/generic.py
modules/catalyst/target/generic_stage.py

index 160a27f14fcd4916b9133bed34254cea2aaf398a..b16bd3847c2d4873ec85882747228debee5e723d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,17 @@
 # Copyright 2002-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS)
 # Distributed under the GPL v2
 
+  14 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
+  modules/catalyst/arch/alpha.py, modules/catalyst/arch/amd64.py,
+  modules/catalyst/arch/arm.py, modules/catalyst/arch/hppa.py,
+  modules/catalyst/arch/ia64.py, modules/catalyst/arch/mips.py,
+  modules/catalyst/arch/powerpc.py, modules/catalyst/arch/s390.py,
+  modules/catalyst/arch/sh.py, modules/catalyst/arch/sparc.py,
+  modules/catalyst/arch/x86.py, modules/catalyst/lock.py,
+  modules/catalyst/target/generic.py,
+  modules/catalyst/target/generic_stage.py:
+  Fix up a few runtime errors
+
   13 Jan 2009; Andrew Gaffney <agaffney@gentoo.org>
   +modules/catalyst/target/system.py, +targets/system/system-chroot.sh,
   +targets/system/system-controller.sh,
index 75f11327c196897f423f0668624c2f8bfb02500d..71e3e652b500baf0dfb3b532b1f4e85c755a3253 100644 (file)
@@ -66,7 +66,7 @@ class arch_ev67(generic_alpha):
                self.settings["CHOST"]="alphaev67-unknown-linux-gnu"
                self.settings["HOSTUSE"]=["ev6"]
 
-__subarch_map = {
+_subarch_map = {
        "alpha": arch_alpha,
        "ev4": arch_ev4,
        "ev45": arch_ev45,
@@ -77,4 +77,4 @@ __subarch_map = {
        "ev67": arch_ev67
 }
 
-__machine_map = ("alpha", )
+_machine_map = ("alpha", )
index 3743ef7667c8071989f1d5d31c87cc0aee7e4319..ce70ccb5d42ebc9e5363d333fb26819daf19c2dc 100644 (file)
@@ -54,7 +54,7 @@ class arch_amdfam10(generic_amd64):
                self.settings["CHOST"]="x86_64-pc-linux-gnu"
                self.settings["HOSTUSE"]=["mmx","sse","sse2","3dnow"]
 
-__subarch_map = {
+_subarch_map = {
        "amd64"         : arch_amd64,
        "k8"            : arch_k8,
        "opteron"       : arch_k8,
@@ -70,5 +70,5 @@ __subarch_map = {
 #      "barcelona"     : arch_amdfam10
 }
 
-__machine_map = ("x86_64","amd64","nocona")
+_machine_map = ("x86_64","amd64","nocona")
 
index 7aa9fb2cd2cebfe96588ec4cccfde8865ec639c9..e7005aa2dd844b074ed1c1aa12ef55518e3af7c0 100644 (file)
@@ -43,13 +43,13 @@ class arch_armv5b(generic_arm):
                self.settings["CFLAGS"]+=" -mcpu=xscale"
                self.settings["CHOST"]="armv5b-unknown-linux-gnu"
 
-__subarch_map = {
+_subarch_map = {
        "arm"    : arch_arm,
        "armv4l" : arch_armv4l,
        "armeb"  : arch_armeb,
        "armv5b" : arch_armv5b
 }
 
-__machine_map = ("arm", "armv4l", "armeb", "armv5b", "armv5tel")
+_machine_map = ("arm", "armv4l", "armeb", "armv5b", "armv5tel")
 
 
index 716d4d8d08f89243dfd36d0ef42b904efc41cda9..3c75c3881863231c40b63cfd4f93daa3e0e280b0 100644 (file)
@@ -30,11 +30,11 @@ class arch_hppa2_0(generic_hppa):
                self.settings["CFLAGS"]+=" -march=2.0"
                self.settings["CHOST"]="hppa2.0-unknown-linux-gnu"
 
-__subarch_map = {
+_subarch_map = {
        "hppa":         arch_hppa,
        "hppa1.1":      arch_hppa1_1,
        "hppa2.0":      arch_hppa2_0
 }
 
-__machine_map = ("parisc","parisc64","hppa","hppa64")
+_machine_map = ("parisc","parisc64","hppa","hppa64")
 
index ec52e27461b7bcdad7353f3dd0270d08be003be9..be7f636e9449de851962e7f772bc2342f4e0a142 100644 (file)
@@ -10,9 +10,9 @@ class arch_ia64(catalyst.arch.generic_arch):
                self.settings["CFLAGS"]="-O2 -pipe"
                self.settings["CHOST"]="ia64-unknown-linux-gnu"
 
-__subarch_map = {
+_subarch_map = {
        "ia64": arch_ia64
 }
 
-__machine_map = ("ia64", )
+_machine_map = ("ia64", )
 
index 54dd83fbb0ba18ce5c54dadacebeac6bbf3a3e77..6d3b22dfc0d53adee2fe3b0659bbe2b744e4917e 100644 (file)
@@ -162,7 +162,7 @@ class arch_ip30_n32(generic_mipsel):
                arch_mips4_n32.__init__(self,myspec)
                self.settings["HOSTUSE"]=["ip30","n32"]
 
-__subarch_map = {
+_subarch_map = {
        "cobalt"                : arch_cobalt,
        "cobalt_n32"    : arch_cobalt_n32,
        "ip27"                  : arch_ip27,
@@ -189,5 +189,5 @@ __subarch_map = {
        "loongson"              : arch_mipsel3,
 }
 
-__machine_map = ("mips","mips64")
+_machine_map = ("mips","mips64")
 
index 410437c361a188426dc071de5498027fc2d654a3..d75e23d540f85f8efbdd8cb4f5cdd171a07473bb 100644 (file)
@@ -105,7 +105,7 @@ class arch_power6(arch_ppc64):
                self.settings["CFLAGS"]="-O2 -pipe -mcpu=power6 -mtune=power6"
                self.settings["HOSTUSE"]=["altivec","ibm"]
 
-__subarch_map = {
+_subarch_map = {
        "970"           : arch_970,
        "cell"          : arch_cell,
        "g3"            : arch_g3,
@@ -121,5 +121,5 @@ __subarch_map = {
        "ppc64"         : arch_ppc64
 }
 
-__machine_map = ("ppc","ppc64","powerpc","powerpc64")
+_machine_map = ("ppc","ppc64","powerpc","powerpc64")
 
index a21609edd0e98b38d3b88522495c1b2bfdbfdd16..107a7e91cf91713c15e7a8aa17a520910f3e2f21 100644 (file)
@@ -27,10 +27,10 @@ class arch_s390x(generic_s390x):
                self.settings["CFLAGS"]="-O2 -pipe"
                self.settings["CHOST"]="s390x-ibm-linux-gnu"
 
-__subarch_map = {
+_subarch_map = {
        "s390": arch_s390,
        "s390x": arch_s390x
 }
 
-__machine_map = ("s390", "s390x")
+_machine_map = ("s390", "s390x")
 
index 4b77b36a513e56fda705b8895672fc80b05a7ad5..8f4ce71ced4d2bcc89dc6aaaa81f5a7a053d282b 100644 (file)
@@ -69,7 +69,7 @@ class arch_sh4eb(generic_sheb):
                self.settings["CFLAGS"]="-O2 -m4 -pipe"
                self.settings["CHOST"]="sh4eb-unknown-linux-gnu"
 
-__subarch_map = {
+_subarch_map = {
        "sh"    :arch_sh,
        "sh2"   :arch_sh2,
        "sh3"   :arch_sh3,
@@ -80,5 +80,5 @@ __subarch_map = {
        "sh4eb" :arch_sh4eb
 }
 
-__machine_map = ("sh2","sh3","sh4","sh2eb","sh3eb","sh4eb")
+_machine_map = ("sh2","sh3","sh4","sh2eb","sh3eb","sh4eb")
 
index 129e9c1d8a4031b3bbc19b5352ea4f9fc5d6b748..14ee1e0f4b0a4338d2baef3e54dd20bef850d501 100644 (file)
@@ -34,10 +34,10 @@ class arch_sparc64(generic_sparc64):
                self.settings["CFLAGS"]="-O2 -mcpu=ultrasparc -pipe"
                self.settings["CHOST"]="sparc-unknown-linux-gnu"
 
-__subarch_map = {
+_subarch_map = {
        "sparc"         : arch_sparc,
        "sparc64"       : arch_sparc64
 }
 
-__machine_map = ("sparc","sparc64")
+_machine_map = ("sparc","sparc64")
 
index 8fe038a9a9788e628f141ebefb36d4b289f5a902..f4e76a0bbd1b16ac008a781f1fc2be3ceef1a681 100644 (file)
@@ -123,7 +123,7 @@ class arch_athlon_xp(generic_x86):
                self.settings["CHOST"]="i686-pc-linux-gnu"
                self.settings["HOSTUSE"]=["mmx","3dnow","sse"]
 
-__subarch_map = {
+_subarch_map = {
        "x86"                   : arch_x86,
        "i386"                  : arch_i386,
        "i486"                  : arch_i486,
@@ -149,5 +149,5 @@ __subarch_map = {
        "athlon-mp"             : arch_athlon_xp
 }
 
-__machine_map = ('i386', 'i486', 'i586', 'i686')
+_machine_map = ('i386', 'i486', 'i586', 'i686')
 
index ea423107c8fa8174df00e82b3296df278b83aaf9..8e79ac874de67737323c20a67d145199574084c5 100644 (file)
@@ -5,6 +5,7 @@ import os
 import stat
 import sys
 import time
+from os.path import normpath
 from catalyst.output import *
 
 def writemsg(mystr):
index 944043cd8e812fb68902fcd41f968793715d0aed..20b84224f5d2306be0ba97c2507423687801a47b 100644 (file)
@@ -17,6 +17,9 @@ class generic_target:
                self.settings = self.config.get_spec().get_values()
                self.settings.update(self.config.get_conf())
 
+               self.required_values = []
+               self.valid_values = []
+
                self.env={}
                self.env["PATH"]="/bin:/sbin:/usr/bin:/usr/sbin"
 
index 45fa1f90cf6298e65daec0528e1bf31f9f0b4931..0bee86b52de1da5bf44cab32a640e19f84d7a5be 100644 (file)
@@ -25,7 +25,7 @@ class generic_stage_target(generic_target):
                        "cflags","cxxflags","ldflags","cbuild","hostuse","portage_overlay",\
                        "distcc_hosts","makeopts","pkgcache_path","kerncache_path"])
 
-               self.set_valid_build_kernel_vars(addlargs)
+               self.set_valid_build_kernel_vars()
 
                """
                The semantics of subarchmap and machinemap changed a bit in 2.0.3 to
@@ -57,11 +57,11 @@ class generic_stage_target(generic_target):
 
                arches = catalyst.arch.get_arches()
                for x in arches:
-                       self.subarchmap.update(arches[x].__subarch_map)
-                       for machine in arches[x].__machine_map:
-                               machinemap[machine] = arches[x]
-                       for subarch in arches[x].__subarch_map:
-                               machinemap[subarch] = arches[x]
+                       self.subarchmap.update(arches[x]._subarch_map)
+                       for machine in arches[x]._machine_map:
+                               machinemap[machine] = x
+                       for subarch in arches[x]._subarch_map:
+                               machinemap[subarch] = x
 
                if "chost" in self.settings:
                        hostmachine = self.settings["chost"].split("-")[0]
@@ -434,12 +434,12 @@ class generic_stage_target(generic_target):
                """ ROOT= variable for emerges """
                self.settings["root_path"]="/"
 
-       def set_valid_build_kernel_vars(self,addlargs):
-               if "boot/kernel" in addlargs:
-                       if type(addlargs["boot/kernel"])==types.StringType:
-                               loopy=[addlargs["boot/kernel"]]
+       def set_valid_build_kernel_vars(self):
+               if "boot/kernel" in self.settings:
+                       if type(self.settings["boot/kernel"])==types.StringType:
+                               loopy=[self.settings["boot/kernel"]]
                        else:
-                               loopy=addlargs["boot/kernel"]
+                               loopy=self.settings["boot/kernel"]
 
                        for x in loopy:
                                self.valid_values.append("boot/kernel/"+x+"/aliases")
@@ -454,11 +454,11 @@ class generic_stage_target(generic_target):
                                self.valid_values.append("boot/kernel/"+x+"/softlevel")
                                self.valid_values.append("boot/kernel/"+x+"/use")
                                self.valid_values.append("boot/kernel/"+x+"/packages")
-                               if "boot/kernel/"+x+"/packages" in addlargs:
-                                       if type(addlargs["boot/kernel/"+x+\
+                               if "boot/kernel/"+x+"/packages" in self.settings:
+                                       if type(self.settings["boot/kernel/"+x+\
                                                "/packages"])==types.StringType:
-                                               addlargs["boot/kernel/"+x+"/packages"]=\
-                                                       [addlargs["boot/kernel/"+x+"/packages"]]
+                                               self.settings["boot/kernel/"+x+"/packages"]=\
+                                                       [self.settings["boot/kernel/"+x+"/packages"]]
 
        def kill_chroot_pids(self):
                msg("Checking for processes running in chroot and killing them.")
@@ -1122,7 +1122,8 @@ class generic_stage_target(generic_target):
                        msg("--- Running action sequence: " + x)
                        sys.stdout.flush()
                        try:
-                               apply(getattr(self,x))
+                               func = getattr(self, x)
+                               func()
                        except:
                                self.mount_safety_check()
                                raise