r3981 - in trunk/kernel/source/linux-2.6: . debian debian/arch debian/arch/alpha debian/arch/amd64 debian/arch/arm debian/arch/hppa debian/arch/i386 debian/arch/ia64 debian/arch/m68k debian/arch/powerpc debian/arch/s390 debian/arch/sparc debian/bin debian/templates

Bastian Blank waldi at costa.debian.org
Fri Aug 19 10:31:39 UTC 2005


Author: waldi
Date: 2005-08-19 10:31:32 +0000 (Fri, 19 Aug 2005)
New Revision: 3981

Added:
   trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390-tape
Modified:
   trunk/kernel/source/linux-2.6/
   trunk/kernel/source/linux-2.6/debian/arch/alpha/config
   trunk/kernel/source/linux-2.6/debian/arch/alpha/defines
   trunk/kernel/source/linux-2.6/debian/arch/amd64/config
   trunk/kernel/source/linux-2.6/debian/arch/amd64/defines
   trunk/kernel/source/linux-2.6/debian/arch/arm/defines
   trunk/kernel/source/linux-2.6/debian/arch/config
   trunk/kernel/source/linux-2.6/debian/arch/defines
   trunk/kernel/source/linux-2.6/debian/arch/hppa/defines
   trunk/kernel/source/linux-2.6/debian/arch/i386/config
   trunk/kernel/source/linux-2.6/debian/arch/i386/defines
   trunk/kernel/source/linux-2.6/debian/arch/ia64/defines
   trunk/kernel/source/linux-2.6/debian/arch/m68k/defines
   trunk/kernel/source/linux-2.6/debian/arch/powerpc/Makefile.inc
   trunk/kernel/source/linux-2.6/debian/arch/powerpc/config
   trunk/kernel/source/linux-2.6/debian/arch/powerpc/defines
   trunk/kernel/source/linux-2.6/debian/arch/s390/config
   trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390
   trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390x
   trunk/kernel/source/linux-2.6/debian/arch/s390/defines
   trunk/kernel/source/linux-2.6/debian/arch/sparc/Makefile.inc
   trunk/kernel/source/linux-2.6/debian/arch/sparc/defines
   trunk/kernel/source/linux-2.6/debian/bin/gencontrol.py
   trunk/kernel/source/linux-2.6/debian/rules.real
   trunk/kernel/source/linux-2.6/debian/templates/control.headers.in
Log:
* Add more strict dependency between the headers packages.
* Use own config to define arches, subarches and flavours.
* Aggregate ATM options.
* Add kernel config for s390 tape image.
* Fix subarch setting for sparc.

r3970: waldi | 2005-08-18 17:58:13 +0000
debian/templates/control.headers.in: Add more strict dependency.

r3971: waldi | 2005-08-18 18:02:08 +0000
Use own config to define arches, subarches and flavours.

* debian/arch/defines: Include architecture definitions.
* debian/arch/alpha/defines, debian/arch/amd64/defines, debian/arch/arm/defines,
  debian/arch/hppa/defines, debian/arch/i386/defines, debian/arch/ia64/defines,
  debian/arch/m68k/defines, debian/arch/powerpc/defines, debian/arch/s390/defines,
  debian/arch/sparc/defines: Include flavour definitions.
* debian/bin/gencontrol.py
  - Read all configs at once.
  - Use config definitions for arch, subarch and flavour detection.

r3972: waldi | 2005-08-18 18:50:08 +0000
debian/arch/alpha/config, debian/arch/amd64/config, debian/arch/config,
debian/arch/i386/config, debian/arch/powerpc/config: Aggregate ATM options.

r3973: waldi | 2005-08-18 18:52:30 +0000
Add kernel config for s390 tape image.

* debian/arch/s390/config: Remove IPL options.
* debian/arch/s390/config.s390 debian/arch/s390/config.s390x: Add IPL options.
* debian/arch/s390/config.s390-tape: Add.

r3974: waldi | 2005-08-18 18:55:49 +0000
debian/bin/gencontrol.py: Don't output not available arches.

r3975: waldi | 2005-08-18 18:57:32 +0000
debian/arch/sparc/defines: Set kpkg-subarch to sparc64.

r3976: waldi | 2005-08-18 19:06:23 +0000
* debian/arch/powerpc/Makefile.inc, debian/arch/sparc/Makefile.inc: Remove old subarch settings.
* debian/bin/gencontrol.py: Support per subarch kpkg-subarch.
* debian/rules.real: Use subarch for header builds.



Property changes on: trunk/kernel/source/linux-2.6
___________________________________________________________________
Name: svk:merge
   - 510b9475-24dd-0310-9b6c-e0eefe99d49f:/branches/kernel/source/linux-2.6/release-2.6.12-2:3782
510b9475-24dd-0310-9b6c-e0eefe99d49f:/people/waldi/kernel/source/linux-2.6:3875
   + 510b9475-24dd-0310-9b6c-e0eefe99d49f:/branches/kernel/source/linux-2.6/release-2.6.12-2:3782
510b9475-24dd-0310-9b6c-e0eefe99d49f:/people/waldi/kernel/source/linux-2.6:3976

Modified: trunk/kernel/source/linux-2.6/debian/arch/alpha/config
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/alpha/config	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/alpha/config	2005-08-19 10:31:32 UTC (rev 3981)
@@ -508,11 +508,6 @@
 # CONFIG_SCTP_HMAC_NONE is not set
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
-# CONFIG_ATM_CLIP_NO_ICMP is not set
-CONFIG_ATM_LANE=m
-CONFIG_ATM_MPOA=m
-CONFIG_ATM_BR2684=m
-# CONFIG_ATM_BR2684_IPFILTER is not set
 CONFIG_BRIDGE=m
 CONFIG_DECNET=m
 # CONFIG_DECNET_ROUTER is not set
@@ -819,7 +814,6 @@
 CONFIG_CYCLOMX_X25=y
 CONFIG_LAPBETHER=m
 CONFIG_X25_ASY=m
-CONFIG_ATM_TCP=m
 CONFIG_ATM_LANAI=m
 CONFIG_ATM_ENI=m
 # CONFIG_ATM_ENI_DEBUG is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/alpha/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/alpha/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/alpha/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,5 @@
-[DEFAULT]
+[base]
+flavours: alpha-generic alpha-smp
 suggests: aboot, fdutils
 
 [alpha-generic]

Modified: trunk/kernel/source/linux-2.6/debian/arch/amd64/config
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/amd64/config	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/amd64/config	2005-08-19 10:31:32 UTC (rev 3981)
@@ -528,11 +528,6 @@
 # CONFIG_SCTP_HMAC_NONE is not set
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
-# CONFIG_ATM_CLIP_NO_ICMP is not set
-CONFIG_ATM_LANE=m
-CONFIG_ATM_MPOA=m
-CONFIG_ATM_BR2684=m
-# CONFIG_ATM_BR2684_IPFILTER is not set
 CONFIG_BRIDGE=m
 CONFIG_DECNET=m
 # CONFIG_DECNET_ROUTER is not set
@@ -794,7 +789,6 @@
 CONFIG_X25_ASY=m
 CONFIG_SBNI=m
 # CONFIG_SBNI_MULTILINE is not set
-CONFIG_ATM_TCP=m
 CONFIG_ATM_LANAI=m
 CONFIG_ATM_ENI=m
 # CONFIG_ATM_ENI_DEBUG is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/amd64/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/amd64/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/amd64/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,3 +1,9 @@
-[DEFAULT]
+[base]
 depends: e2fsprogs (>= 1.35-7)
+flavours:
+ amd64-generic
+ amd64-k8
+ amd64-k8-smp
+ em64t-p4
+ em64t-p4-smp
 suggests: lilo (>= 19.1) | grub, fdutils

Modified: trunk/kernel/source/linux-2.6/debian/arch/arm/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/arm/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/arm/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,2 +1,7 @@
-[DEFAULT]
+[base]
+flavours:
+ footbridge
+ ixp4xx
+ rpc
+ s3c2410
 suggests: fdutils

Modified: trunk/kernel/source/linux-2.6/debian/arch/config
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/config	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/config	2005-08-19 10:31:32 UTC (rev 3981)
@@ -180,3 +180,9 @@
 CONFIG_6PACK=m
 CONFIG_ATM=m
 CONFIG_ATM_CLIP=m
+# CONFIG_ATM_CLIP_NO_ICMP is not set
+CONFIG_ATM_LANE=m
+CONFIG_ATM_MPOA=m
+CONFIG_ATM_BR2684=m
+# CONFIG_ATM_BR2684_IPFILTER is not set
+# CONFIG_ATM_TCP is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,2 +1,24 @@
-[DEFAULT]
+[base]
 abiname: 1
+arches:
+ alpha
+ amd64
+ arm
+ hppa
+ i386
+ ia64
+ m68k
+ mips
+ mipsel
+ powerpc
+ s390
+ sparc
+
+[alpha]
+#enabled: False
+
+[mips]
+available: False
+
+[mipsel]
+available: False

Modified: trunk/kernel/source/linux-2.6/debian/arch/hppa/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/hppa/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/hppa/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,9 @@
-[DEFAULT]
+[base]
+flavours:
+ 32
+ 32-smp
+ 64
+ 64-smp
 suggests: palo
 
 [32]

Modified: trunk/kernel/source/linux-2.6/debian/arch/i386/config
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/i386/config	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/i386/config	2005-08-19 10:31:32 UTC (rev 3981)
@@ -624,11 +624,6 @@
 # CONFIG_SCTP_HMAC_NONE is not set
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
-# CONFIG_ATM_CLIP_NO_ICMP is not set
-CONFIG_ATM_LANE=m
-CONFIG_ATM_MPOA=m
-CONFIG_ATM_BR2684=m
-# CONFIG_ATM_BR2684_IPFILTER is not set
 CONFIG_BRIDGE=m
 CONFIG_DECNET=m
 # CONFIG_DECNET_ROUTER is not set
@@ -946,7 +941,6 @@
 CONFIG_X25_ASY=m
 CONFIG_SBNI=m
 # CONFIG_SBNI_MULTILINE is not set
-CONFIG_ATM_TCP=m
 CONFIG_ATM_LANAI=m
 CONFIG_ATM_ENI=m
 # CONFIG_ATM_ENI_DEBUG is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/i386/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/i386/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/i386/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,10 @@
-[DEFAULT]
+[base]
+flavours:
+ 386
+ 686
+ 686-smp
+ k7
+ k7-smp
 suggests: lilo (>= 19.1) | grub, fdutils
 
 [686]
@@ -13,7 +19,6 @@
 class: AMD K7
 longclass: 32bit AMD Duron/Athlon/AthlonXP
 
-
 [k7-smp]
 class: AMD K7 SMP
 longclass: 32-bit multi-processor AMD Duron/Athlon/AthlonXP

Modified: trunk/kernel/source/linux-2.6/debian/arch/ia64/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/ia64/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/ia64/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,9 @@
-[DEFAULT]
+[base]
+flavours:
+ itanium
+ itanium-smp
+ mckinley
+ mckinley-smp
 suggests: elilo, fdutils
 
 [itanium]

Modified: trunk/kernel/source/linux-2.6/debian/arch/m68k/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/m68k/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/m68k/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,14 @@
-[DEFAULT]
+[base]
+flavours:
+ amiga
+ atari
+ bvme6000
+ hp
+ mac
+ mvme147
+ mvme16x
+ q40
+ sun3
 suggests: vmelilo, fdutils
 
 [amiga]

Modified: trunk/kernel/source/linux-2.6/debian/arch/powerpc/Makefile.inc
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/powerpc/Makefile.inc	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/powerpc/Makefile.inc	2005-08-19 10:31:32 UTC (rev 3981)
@@ -2,5 +2,3 @@
 # Variables 
 #
 headers_dirs = ppc | ppc64 | m68k
-headers_subarch = powerpc
-build_subarch = powerpc

Modified: trunk/kernel/source/linux-2.6/debian/arch/powerpc/config
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/powerpc/config	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/powerpc/config	2005-08-19 10:31:32 UTC (rev 3981)
@@ -387,11 +387,6 @@
 # CONFIG_SCTP_HMAC_NONE is not set
 # CONFIG_SCTP_HMAC_SHA1 is not set
 CONFIG_SCTP_HMAC_MD5=y
-CONFIG_ATM_CLIP_NO_ICMP=y
-CONFIG_ATM_LANE=m
-CONFIG_ATM_MPOA=m
-CONFIG_ATM_BR2684=m
-# CONFIG_ATM_BR2684_IPFILTER is not set
 CONFIG_BRIDGE=m
 CONFIG_DECNET=m
 CONFIG_DECNET_ROUTER=y
@@ -647,7 +642,6 @@
 CONFIG_CYCLOMX_X25=y
 CONFIG_LAPBETHER=m
 CONFIG_X25_ASY=m
-CONFIG_ATM_TCP=m
 CONFIG_ATM_LANAI=m
 CONFIG_ATM_ENI=m
 # CONFIG_ATM_ENI_DEBUG is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/powerpc/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/powerpc/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/powerpc/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,8 @@
-[DEFAULT]
+[base]
+flavours:
+ powerpc
+ powerpc-smp
+ powerpc64
 kpkg-subarch: powerpc
 
 [powerpc]

Modified: trunk/kernel/source/linux-2.6/debian/arch/s390/config
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/s390/config	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/s390/config	2005-08-19 10:31:32 UTC (rev 3981)
@@ -26,8 +26,6 @@
 # CONFIG_QDIO_DEBUG is not set
 # CONFIG_PREEMPT is not set
 CONFIG_IPL=y
-# CONFIG_IPL_TAPE is not set
-CONFIG_IPL_VM=y
 # CONFIG_PROCESS_DEBUG is not set
 CONFIG_PFAULT=y
 # CONFIG_SHARED_KERNEL is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390	2005-08-19 10:31:32 UTC (rev 3981)
@@ -5,5 +5,7 @@
 CONFIG_MATHEMU=y
 CONFIG_MARCH_G5=y
 # CONFIG_MARCH_Z900 is not set
+# CONFIG_IPL_TAPE is not set
+CONFIG_IPL_VM=y
 # CONFIG_LBD is not set
 # CONFIG_DASD_DIAG is not set

Added: trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390-tape
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390-tape	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390-tape	2005-08-19 10:31:32 UTC (rev 3981)
@@ -0,0 +1,11 @@
+CONFIG_UID16=y
+# CONFIG_ARCH_S390X is not set
+# CONFIG_64BIT is not set
+CONFIG_ARCH_S390_31=y
+CONFIG_MATHEMU=y
+CONFIG_MARCH_G5=y
+# CONFIG_MARCH_Z900 is not set
+CONFIG_IPL_TAPE=y
+# CONFIG_IPL_VM is not set
+# CONFIG_LBD is not set
+# CONFIG_DASD_DIAG is not set

Modified: trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390x
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390x	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/s390/config.s390x	2005-08-19 10:31:32 UTC (rev 3981)
@@ -6,3 +6,5 @@
 CONFIG_BINFMT_ELF32=y
 # CONFIG_MARCH_G5 is not set
 CONFIG_MARCH_Z900=y
+# CONFIG_IPL_TAPE is not set
+CONFIG_IPL_VM=y

Modified: trunk/kernel/source/linux-2.6/debian/arch/s390/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/s390/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/s390/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,5 +1,6 @@
-[DEFAULT]
+[base]
 desc: This kernel has support to IPL (boot) from a VM reader or DASD device.
+flavours: s390 s390x
 suggests: s390-tools
 
 [s390]

Modified: trunk/kernel/source/linux-2.6/debian/arch/sparc/Makefile.inc
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/sparc/Makefile.inc	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/sparc/Makefile.inc	2005-08-19 10:31:32 UTC (rev 3981)
@@ -2,8 +2,6 @@
 # Variables 
 #
 headers_dirs := sparc64
-headers_subarch := sparc64
-build_subarch := @flavour@
 image_postproc = strip -R .comment -R .note -K sun4u_init -K _end -K _start arch/$(subst 32,,$(subst -smp,,$*))/boot/image
 # image_prefix_flavours := sparc32 sparc32-smp
 # image_prefix := sparc32

Modified: trunk/kernel/source/linux-2.6/debian/arch/sparc/defines
===================================================================
--- trunk/kernel/source/linux-2.6/debian/arch/sparc/defines	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/arch/sparc/defines	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,4 +1,6 @@
-[DEFAULT]
+[base]
+flavours: sparc64 sparc64-smp
+kpkg-subarch: sparc64
 suggests: silo, fdutils
 
 [sparc64]

Modified: trunk/kernel/source/linux-2.6/debian/bin/gencontrol.py
===================================================================
--- trunk/kernel/source/linux-2.6/debian/bin/gencontrol.py	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/bin/gencontrol.py	2005-08-19 10:31:32 UTC (rev 3981)
@@ -1,6 +1,108 @@
 #!/usr/bin/env python
 import os, os.path, re, sys, textwrap, ConfigParser
 
+config_name = "defines"
+
+class schema_item_boolean(object):
+    def __call__(self, i):
+        i = i.strip().lower()
+        if i in ("true", "1"):
+            return True
+        if i in ("false", "0"):
+            return False
+        raise Error
+
+class schema_item_integer(object):
+    def __call__(self, i):
+        return int(i)
+
+class schema_item_list(object):
+    def __call__(self, i):
+        return re.split("\s+", i.strip())
+
+class schema_item_string(object):
+    def __call__(self, i):
+        return str(i)
+
+class config(dict):
+    schema = {
+        'abiname': schema_item_string,
+        'arches': schema_item_list,
+        'available': schema_item_boolean,
+        'class': schema_item_string,
+        'depends': schema_item_string,
+        'desc': schema_item_string,
+        'flavours': schema_item_list,
+        'kpkg-subarch': schema_item_string,
+        'longclass': schema_item_string,
+        'subarches': schema_item_list,
+        'suggests': schema_item_string,
+    }
+
+    def __init__(self):
+        self._read_base()
+#        import pprint
+#        pprint.pprint(dict(self))
+
+    def _read_arch(self, arch, base):
+        file = "debian/arch/%s/%s" % (arch, config_name)
+        c = config_parser(self.schema)
+        c.read(file)
+        t = c.items_convert('base')
+        base.update(t)
+        self[arch] = t
+        subarches = t.get('subarches', [])
+        for subarch in subarches:
+            raise RuntimeError
+        flavours = t.get('flavours', None)
+        if flavours:
+            for flavour in flavours:
+                self._read_flavour(arch, 'none', flavour, c)
+            subarches.append('none')
+        t['subarches'] = subarches
+
+    def _read_base(self):
+        file = "debian/arch/%s" % config_name
+        c = config_parser(self.schema)
+        c.read(file)
+        t1 = c.items_convert('base')
+        self['base'] = t1
+        for arch in t1['arches']:
+            try:
+                t2 = c.items_convert(arch)
+                avail = t2.get('available', True)
+            except ConfigParser.NoSectionError:
+                t2 = {}
+                avail = True
+            if avail:
+                self._read_arch(arch, t2)
+            else:
+                self[arch] = t2
+
+    def _read_flavour(self, arch, subarch, flavour, c):
+        try:
+            t = c.items_convert(flavour)
+        except ConfigParser.NoSectionError:
+            try:
+                t = c.items_convert("%s-none-%s" % (arch, flavour))
+            except ConfigParser.NoSectionError:
+                #raise RuntimeError("Don't find config for %s-none-%s!" % (arch, flavour))
+                t = {}
+        self["%s-%s-%s" % (arch, subarch, flavour)] = t
+
+class config_parser(object, ConfigParser.ConfigParser):
+    def __init__(self, schema):
+        ConfigParser.ConfigParser.__init__(self)
+        self.schema = schema
+
+    def items_convert(self, section):
+        items = self.items(section)
+        ret = {}
+        for key, value in items:
+            convert = self.schema[key]()
+            ret[key] = convert(value)
+        return ret
+
 class entry(dict):
     __slots__ = ('_list')
 
@@ -35,55 +137,6 @@
         r'(\s+|'                                  # any whitespace
         r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))')   # em-dash
 
-def config():
-    c = ConfigParser.ConfigParser()
-    c.read("debian/arch/defines")
-    return c
-
-def config_arch(arch):
-    c = config()
-    c.read("debian/arch/%s/defines" % arch)
-    return c
-
-def config_subarch(arch, subarch):
-    c = config_arch(arch)
-    if subarch is not None:
-        c.read("debian/arch/%s/%s/defines" % (arch, subarch))
-    return c
-
-def list_dirs(dir):
-    ret = []
-    for i in os.listdir(dir):
-        if i not in ('.svn',) and os.path.isdir(os.path.join(dir, i)):
-            ret.append(i)
-    return ret
-
-def list_files(dir):
-    ret = []
-    for i in os.listdir(dir):
-        if os.path.isfile(os.path.join(dir, i)):
-            ret.append(i)
-    return ret
-
-def list_arches():
-    return list_dirs("debian/arch")
-
-def list_subarches(arch):
-    ret = [None]
-    ret.extend(list_dirs("debian/arch/%s" % arch))
-    return ret
-
-def list_flavours(arch, subarch):
-    dir = "debian/arch/%s" % arch
-    if subarch is not None:
-        dir += "/%s" % subarch
-    tmp = list_files(dir)
-    ret = []
-    for i in tmp:
-        if i[:7] == 'config.':
-            ret.append(i[7:])
-    return ret
-
 def read_changelog():
     r = re.compile(r"""
 ^
@@ -268,7 +321,7 @@
               f.write(" %s\n" % k)
         f.write('\n')
 
-if __name__ == '__main__':
+def main():
     changelog = read_changelog()
 
     vars = {}
@@ -277,16 +330,25 @@
     version = vars['version']
     source_version = vars['srcver']
 
-    vars.update(config().defaults())
+    c = config()
 
+    vars.update(c['base'])
+
     arches = {}
     subarches_architecture = {}
-    for arch in list_arches():
+    for arch in c['base']['arches']:
+        if not c[arch].get('available', True):
+            continue
         t1 = {}
-        for subarch in list_subarches(arch):
+        for subarch in c[arch].get('subarches', []):
             t2 = {}
-            for flavour in list_flavours(arch, subarch):
-                t2[flavour] = True
+            if subarch != 'none':
+                for flavour in c["%s-%s" % (arch, subarch)].get('flavours', []):
+                    t2[flavour] = True
+            else:
+                for flavour in c[arch].get('flavours', []):
+                    t2[flavour] = True
+                subarch = None
             t1[subarch] = t2
             t3 = subarches_architecture.get(subarch, {})
             t3[arch] = True
@@ -327,7 +389,7 @@
     for arch in arch_list:
         arch_vars = vars.copy()
         arch_vars['arch'] = arch
-        arch_vars.update(config_arch(arch).defaults())
+        arch_vars.update(c[arch])
 
         for i in (('setup',)):
             makefile.append(("%s-%s:: %s-%s-real" % (i, arch, i, arch), None))
@@ -341,13 +403,12 @@
         subarch_list = arches[arch].keys()
         subarch_list.sort()
         for subarch in subarch_list:
-            subarch_config = config_subarch(arch, subarch)
             subarch_vars = arch_vars.copy()
-            subarch_vars.update(subarch_config.defaults())
 
             if subarch is not None:
                 subarch_text = subarch
                 subarch_vars['subarch'] = '%s-' % subarch
+                subarch_vars.update(c['%s-%s' % (arch, subarch)])
             else:
                 subarch_text = 'none'
                 subarch_vars['subarch'] = ''
@@ -360,6 +421,10 @@
 
             subarch_makeflags = arch_makeflags[:]
             subarch_makeflags.extend(["SUBARCH='%s'" % subarch_text, "ABINAME='%s'" % subarch_vars['abiname']])
+            subarch_makeflags_clean = subarch_makeflags[:]
+            if subarch_vars.has_key('kpkg-subarch'):
+                subarch_makeflags.append("KPKG_SUBARCH='%s'" % subarch_vars['kpkg-subarch'])
+
             cmds_binary_arch = []
             cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-subarch %s" % ' '.join(subarch_makeflags),))
             cmds_setup = []
@@ -372,8 +437,9 @@
             for flavour in flavour_list:
                 flavour_vars = subarch_vars.copy()
                 flavour_vars['flavour'] = flavour
+
                 try:
-                    flavour_vars.update(dict(subarch_config.items(flavour)))
+                    flavour_vars.update(c['%s-%s-%s' % (arch, subarch_text, flavour)])
                 except ConfigParser.NoSectionError: pass
                 if not flavour_vars.has_key('class'):
                     flavour_vars['class'] = '%s-class' % flavour
@@ -391,7 +457,7 @@
                     makefile.append(("%s-%s-%s:: %s-%s-%s-%s" % (i, arch, subarch_text, i, arch, subarch_text, flavour), None))
                     makefile.append(("%s-%s-%s-%s:: %s-%s-%s-%s-real" % (i, arch, subarch_text, flavour, i, arch, subarch_text, flavour), None))
 
-                flavour_makeflags = subarch_makeflags[:]
+                flavour_makeflags = subarch_makeflags_clean[:]
                 flavour_makeflags.append("FLAVOUR='%s'" % flavour)
                 if flavour_vars.has_key('kpkg-subarch'):
                     flavour_makeflags.append("KPKG_SUBARCH='%s'" % flavour_vars['kpkg-subarch'])
@@ -418,7 +484,7 @@
     archs.sort()
     for arch in archs:
         arch_vars = vars.copy()
-        arch_vars.update(config_arch(arch).defaults())
+        arch_vars.update(c[arch])
 
         cmds = []
         for i in extra_pn[arch]:
@@ -433,3 +499,5 @@
     write_makefile(makefile)
 
 
+if __name__ == '__main__':
+    main()

Modified: trunk/kernel/source/linux-2.6/debian/rules.real
===================================================================
--- trunk/kernel/source/linux-2.6/debian/rules.real	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/rules.real	2005-08-19 10:31:32 UTC (rev 3981)
@@ -50,10 +50,8 @@
 kpkg_image += --initrd
 ifdef KPKG_SUBARCH
   kpkg_image += --subarch $(KPKG_SUBARCH)
+  kpkg_header += --subarch $(KPKG_SUBARCH)
 endif
-ifdef headers_subarch
-  kpkg_header += --subarch $(headers_subarch)
-endif
 ifneq ($(DEB_BUILD_ARCH),$(DEB_HOST_ARCH))
   kpkg_image += --cross-compile=$(DEB_HOST_GNU_TYPE)
 endif

Modified: trunk/kernel/source/linux-2.6/debian/templates/control.headers.in
===================================================================
--- trunk/kernel/source/linux-2.6/debian/templates/control.headers.in	2005-08-19 07:30:31 UTC (rev 3980)
+++ trunk/kernel/source/linux-2.6/debian/templates/control.headers.in	2005-08-19 10:31:32 UTC (rev 3981)
@@ -2,7 +2,7 @@
 Architecture: @arch@
 Section: devel
 Priority: optional
-Depends: coreutils | fileutils (>= 4.0), linux-headers- at subarch@@version at -@abiname@
+Depends: coreutils | fileutils (>= 4.0), linux-headers- at subarch@@version at -@abiname@ (= ${Source-Version})
 Provides: linux-headers, linux-headers- at major@
 Description: Architecture-specific header files for Linux kernel @version@ on @class@ machines
  This package provides the architecture-specific kernel header files




More information about the Kernel-svn-changes mailing list