r6005: waldi | 2006-03-02 11:06:40 +0100

* debian/lib/python/debian_linux/gencontrol.py:
  Populate UPSTREAMVERSION, ABINAME and LOCALVERSION in an stable fashion.
* debian/rules.real: Use UPSTREAMVERSION, ABINAME and LOCALVERSION.
* debian/templates/control.headers.arch.in,
  debian/templates/control.headers.in,
  debian/templates/control.headers.latest.in,
  debian/templates/control.headers.subarch.in,
  debian/templates/control.image.in,
  debian/templates/control.image.latest.in:
  Use upstreamversion and localversion substitutions.

r6006:  waldi | 2006-03-02 11:16:14 +0100
* debian/lib/python/debian_linux/gencontrol.py: Add SOURCEVERSION.
* debian/rules.real
  - Use SOURCEVERSION.
  - Fix another brocken ABINAME usage.

r6007:  waldi | 2006-03-02 11:41:01 +0100
* debian/arch/defines, debian/arch/alpha/defines, debian/arch/amd64/defines,
  debian/arch/arm/defines, debian/arch/armeb/defines, debian/arch/hppa/defines,
  debian/arch/i386/defines, debian/arch/ia64/defines, debian/arch/m68k/defines,
  debian/arch/mips/defines, debian/arch/mipsel/defines,
  debian/arch/powerpc/defines, debian/arch/s390/defines,
  debian/arch/sparc/defines: Move image specific specs into image section.
* debian/bin/gencontrol.py: Use image section if neccesary.
* debian/lib/python/debian_linux/gencontrol.py: Support image section.

r6008:  waldi | 2006-03-02 11:41:37 +0100
debian/lib/python/debian_linux/config.py: Remove old workaround.

r6009:  waldi | 2006-03-02 12:15:21 +0100
* bin/gencontrol.py: Fix image description addition.
* lib/python/debian_linux/debian.py: Parse Description also.
* lib/python/debian_linux/gencontrol.py: Fix Description setup.
* lib/python/debian_linux/utils.py: Always provide the complete text.

r6010:  waldi | 2006-03-02 12:42:47 +0100
* debian/arch/defines: Add initramfs-generator relations.
* debian/arch/alpha/defines, debian/arch/amd64/defines,
  debian/arch/arm/defines, debian/arch/armeb/defines, debian/arch/hppa/defines,
  debian/arch/i386/defines, debian/arch/ia64/defines, debian/arch/m68k/defines,
  debian/arch/mips/defines, debian/arch/mipsel/defines,
  debian/arch/powerpc/defines, debian/arch/powerpc/vserver/defines,
  debian/arch/s390/defines, debian/arch/sparc/defines:
  Specify initramfs settings.
* debian/bin/gencontrol.py: Generate dependencies for initramfs generators.
* debian/lib/python/debian_linux/config.py: Add more fields.
* debian/lib/python/debian_linux/gencontrol.py: Fix.
* debian/rules.real: Use INITRAMFS.

r6011:  waldi | 2006-03-02 13:05:45 +0100
debian/bin/gencontrol.py,
debian/lib/python/debian_linux/gencontrol.py
- Don't export the usage of the image section into the generic code.
- Fix localversion spec.

r6012:  waldi | 2006-03-02 13:20:58 +0100
debian/lib/python/debian_linux/config.py: Fix section parsing.

r6013:  waldi | 2006-03-02 13:27:44 +0100
* debian/lib/python/debian_linux/config.py: Use a list of directories.
* debian/lib/python/debian_linux/gencontrol.py: Update.

r6014:  waldi | 2006-03-02 13:30:30 +0100
* debian/bin/gencontrol.py: Add base image config entry.
* debian/lib/python/debian_linux/gencontrol.py:
  Remove another usage of the image config sections.

r6030:  waldi | 2006-03-02 17:44:17 +0100
debian/bin/gencontrol.py: Provide correct localversion for the headers build.

svn path=/dists/trunk/linux-2.6/; revision=6031
This commit is contained in:
Bastian Blank 2006-03-02 16:47:30 +00:00
parent af4c47d96b
commit 333210a7a7
27 changed files with 209 additions and 135 deletions

View File

@ -1,11 +1,11 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool
flavours: alpha-generic alpha-smp alpha-legacy
suggests: aboot, fdutils
kernel-arch: alpha
kernel-header-dirs: alpha
[image]
suggests: aboot, fdutils
[alpha-generic]
class = Alpha

View File

@ -1,5 +1,4 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool, e2fsprogs (>= 1.35-7)
flavours:
amd64-generic
amd64-k8
@ -9,6 +8,9 @@ flavours:
kernel-arch: x86_64
kernel-header-dirs: x86_64
subarches: vserver
[image]
depends: e2fsprogs (>= 1.35-7)
suggests: grub | lilo (>= 19.1)
[amd64-generic]

View File

@ -1,5 +1,4 @@
[base]
depends: yaird | initramfs-tools | linux-initramfs-tool
flavours:
footbridge
ixp4xx
@ -8,6 +7,9 @@ flavours:
s3c2410
kernel-arch: arm
kernel-header-dirs: arm
[image]
initramfs-generators: yaird initramfs-tools
suggests: fdutils
[footbridge]

View File

@ -1,10 +1,12 @@
[base]
depends: yaird | initramfs-tools | linux-initramfs-tool
flavours:
nslu2
kernel-arch: arm
kernel-header-dirs: arm
[image]
initramfs-generators: yaird initramfs-tools
[nslu2]
class: NSLU2
longclass: Linksys NSLU2 (Network Storage Link for USB 2.0 Disk Drives)

17
debian/arch/defines vendored
View File

@ -1,5 +1,7 @@
[base]
[abiname]
abiname: 1
[base]
arches:
alpha
amd64
@ -14,12 +16,19 @@ arches:
powerpc
s390
sparc
image-ramdisk-generators: yaird initramfs-tools
[image]
initramfs-generators: initramfs-tools yaird
type: kernel-package
[image-ramdisk-generators]
yaird: mkinitrd.yaird
[image-initramfs-generators]
initramfs-tools: mkinitramfs
yaird: mkinitrd.yaird
[relations-image-initramfs-generators]
fallback: linux-initramfs-tool
initramfs-tools: initramfs-tools
yaird: yaird
[relations]
gcc: gcc (>= 4:4.0)

View File

@ -1,5 +1,4 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool
flavours:
parisc
parisc-smp
@ -7,6 +6,8 @@ flavours:
parisc64-smp
kernel-arch: parisc
kernel-header-dirs: parisc
[image]
suggests: palo
[parisc]

View File

@ -1,5 +1,4 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool
flavours:
486
686
@ -9,25 +8,35 @@ flavours:
kernel-arch: i386
kernel-header-dirs: i386
subarches: vserver
[image]
suggests: grub | lilo (>= 19.1)
[686]
class: PPro/Celeron/PII/PIII/P4
longclass: Pentium Pro/Celeron/Pentium II/Pentium III/Pentium 4
[686_image]
recommends: libc6-i686
[686-smp]
class: PPro/Celeron/PII/PIII/P4 SMP
longclass: multi-processor Pentium Pro/Celeron/Pentium II/Pentium III/Pentium 4
[686-smp_image]
recommends: libc6-i686
[k7]
class: AMD K7
longclass: 32bit AMD Duron/Athlon/AthlonXP
[k7_image]
recommends: libc6-i686
[k7-smp]
class: AMD K7 SMP
longclass: 32-bit multi-processor AMD Duron/Athlon/AthlonXP
[k7-smp_image]
recommends: libc6-i686

View File

@ -1,5 +1,4 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool
flavours:
itanium
itanium-smp
@ -7,6 +6,8 @@ flavours:
mckinley-smp
kernel-arch: ia64
kernel-header-dirs: ia64
[image]
suggests: elilo, fdutils
[itanium]

View File

@ -1,5 +1,4 @@
[base]
depends: yaird | initramfs-tools | linux-initramfs-tool
compiler: gcc-3.3
flavours:
amiga
@ -13,6 +12,9 @@ flavours:
sun3
kernel-arch: m68k
kernel-header-dirs: m68k
[image]
initramfs-generators: yaird initramfs-tools
suggests: vmelilo, fdutils
[amiga]

View File

@ -7,6 +7,9 @@ kernel-arch: mips
kernel-header-dirs: mips
initrd: no
[image]
initramfs: false
[r4k-ip22]
class: SGI IP22
longclass: SGI IP22 (Indy, Indigo2)

View File

@ -6,6 +6,9 @@ kernel-arch: mips
kernel-header-dirs: mips
initrd: no
[image]
initramfs: false
[r5k-cobalt]
class: Cobalt
longclass: Cobalt (Qube, RaQ, Qube2, RaQ2)

View File

@ -1,5 +1,4 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool
flavours:
powerpc
powerpc-smp
@ -10,17 +9,19 @@ kernel-arch: powerpc
kpkg-subarch: ppc
subarches: vserver
[image]
[apus]
depends: initramfs-tools | yaird | linux-initramfs-tool, mkvmlinuz (>= 18)
depends: mkvmlinuz (>= 18)
[powerpc]
depends: initramfs-tools | yaird | linux-initramfs-tool, mkvmlinuz (>= 18)
depends: mkvmlinuz (>= 18)
[powerpc-smp]
depends: initramfs-tools | yaird | linux-initramfs-tool, mkvmlinuz (>= 18)
depends: mkvmlinuz (>= 18)
[powerpc-miboot]
depends: initramfs-tools | yaird | linux-initramfs-tool, mkvmlinuz (>= 18)
depends: mkvmlinuz (>= 18)
[powerpc64]
kpkg-subarch: powerpc64

View File

@ -4,7 +4,7 @@ flavours:
powerpc64
[powerpc]
depends: initramfs-tools | yaird | linux-initramfs-tool, mkvmlinuz (>= 18)
depends: mkvmlinuz (>= 18)
[powerpc64]
kpkg-subarch: powerpc64

View File

@ -1,11 +1,13 @@
[base]
desc: This kernel has support to IPL (boot) from a VM reader or DASD device.
depends: yaird | initramfs-tools | linux-initramfs-tool
flavours: s390 s390x
suggests: s390-tools
kernel-arch: s390
kernel-header-dirs: s390
[image]
desc: This kernel has support to IPL (boot) from a VM reader or DASD device.
initramfs-generators: yaird
suggests: s390-tools
[s390]
class: IBM S/390

View File

@ -1,18 +1,21 @@
[base]
depends: initramfs-tools | yaird | linux-initramfs-tool
flavours:
sparc32
sparc64
sparc64-smp
[image]
suggests: silo, fdutils
[sparc32]
kernel-arch: sparc
kernel-subarch: sparc
kernel-headers-dirs: sparc
image-postproc: sparc32-image-postproc
class: uniprocessor sparc32 (sun4m) machines
[sparc32_image]
image-postproc: sparc32-image-postproc
[sparc64]
kernel-arch: sparc64
kpkg-subarch: sparc64

View File

@ -5,6 +5,9 @@ import debian_linux.gencontrol
from debian_linux.debian import *
class gencontrol(debian_linux.gencontrol.gencontrol):
def do_main_setup(self, vars, makeflags):
vars.update(self.config['image',])
def do_main_packages(self, packages):
vars = self.changelog_vars
@ -37,21 +40,17 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
def do_arch_packages_post(self, packages, makefile, arch, vars, makeflags, extra):
makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])
# Append this here so it only occurs on the install-headers-all line
# makeflags_string += " FLAVOURS='%s' " % ' '.join(['%s' % i for i in config_entry['flavours']])
cmds_binary_arch = []
cmds_binary_arch.append(("$(MAKE) -f debian/rules.real install-headers-all GENCONTROL_ARGS='\"-Vkernel:Depends=%s\"' %s" % (', '.join(extra['headers_arch_depends']), makeflags_string),))
makefile.append(("binary-arch-%s-real:" % arch, cmds_binary_arch))
def do_subarch_makeflags(self, makeflags, arch, subarch):
config_entry = self.config.merge('base', arch, subarch)
def do_subarch_setup(self, vars, makeflags, arch, subarch):
vars.update(self.config.get(('image', arch, subarch), {}))
for i in ('kernel-header-dirs', 'KERNEL_HEADER_DIRS'),:
if config_entry.has_key(i[0]):
makeflags[i[1]] = config_entry[i[0]]
localversion_headers = ''
if subarch != 'none':
localversion_headers = '-' + subarch
makeflags['LOCALVERSION_HEADERS'] = localversion_headers
if vars.has_key(i[0]):
makeflags[i[1]] = vars[i[0]]
vars['localversion_headers'] = vars['localversion']
makeflags['LOCALVERSION_HEADERS'] = vars['localversion_headers']
def do_subarch_packages(self, packages, makefile, arch, subarch, vars, makeflags, extra):
headers_subarch = self.templates["control.headers.subarch"]
@ -75,8 +74,8 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
makefile.append("build-%s-%s-real:" % (arch, subarch))
makefile.append(("setup-%s-%s-real:" % (arch, subarch), cmds_setup))
def do_flavour_makeflags(self, makeflags, arch, subarch, flavour):
config_entry = self.config.merge('base', arch, subarch, flavour)
def do_flavour_setup(self, vars, makeflags, arch, subarch, flavour):
vars.update(self.config.get(('image', arch, subarch, flavour), {}))
for i in (
('compiler', 'COMPILER'),
('kernel-arch', 'KERNEL_ARCH'),
@ -84,19 +83,12 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
('kpkg-arch', 'KPKG_ARCH'),
('kpkg-subarch', 'KPKG_SUBARCH'),
('image-postproc', 'IMAGE_POSTPROC'),
('initrd', 'INITRD',),
('initramfs', 'INITRAMFS',),
('type', 'TYPE'),
):
if config_entry.has_key(i[0]):
makeflags[i[1]] = config_entry[i[0]]
localversion = ''
localversion_headers = ''
if subarch != 'none':
localversion = '-' + subarch
localversion_headers = '-' + subarch
localversion += '-' + flavour
makeflags['LOCALVERSION'] = localversion
makeflags['LOCALVERSION_HEADERS'] = localversion_headers
if vars.has_key(i[0]):
makeflags[i[1]] = vars[i[0]]
makeflags['LOCALVERSION'] = vars['localversion']
def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
image = self.templates["control.image"]
@ -104,9 +96,19 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
image_latest = self.templates["control.image.latest"]
headers_latest = self.templates["control.headers.latest"]
image_depends = package_relation_list()
if vars.get('initramfs', True):
generators = vars['initramfs-generators']
config_entry_initramfs = self.config.merge('image-initramfs-generators', arch, subarch, flavour)
config_entry_relations_initramfs = self.config.merge('relations-image-initramfs-generators', arch, subarch, flavour)
l = package_relation_group()
l.extend([package_relation(config_entry_relations_initramfs[i]) for i in generators])
l.append(package_relation(config_entry_relations_initramfs['fallback']))
image_depends.append(l)
packages_own = []
packages_dummy = []
packages_own.append(self.process_real_image(image[0], vars))
packages_own.append(self.process_real_image(image[0], image_depends, vars))
packages_own.append(self.process_package(headers[0], vars))
packages_dummy.extend(self.process_packages(image_latest, vars))
packages_dummy.append(self.process_package(headers_latest[0], vars))
@ -135,15 +137,16 @@ class gencontrol(debian_linux.gencontrol.gencontrol):
makefile.append(("build-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_build))
makefile.append(("setup-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_setup))
def process_real_image(self, in_entry, vars):
in_entry = in_entry.copy()
if vars.has_key('desc'):
in_entry['Description'] += "\n.\n" + vars['desc']
def process_real_image(self, in_entry, depends, vars):
entry = self.process_package(in_entry, vars)
if vars.has_key('desc'):
entry['Description'].long[1:1] = [vars['desc']]
for field in 'Depends', 'Provides', 'Suggests', 'Recommends', 'Conflicts':
value = entry.get(field, package_relation_list())
t = vars.get(field.lower(), [])
value.extend(t)
if depends and field == 'Depends':
value.append(depends)
entry[field] = value
return entry

View File

@ -29,24 +29,22 @@ class config_reader(dict):
'arches': schema_item_list(),
'available': schema_item_boolean(),
'flavours': schema_item_list(),
'initramfs': schema_item_boolean(),
'initramfs-generators': schema_item_list(),
'subarches': schema_item_list(),
}
config_name = "defines"
def __init__(self, underlay = None):
self._underlay = underlay
def __init__(self, dirs = []):
self._dirs = dirs
self._read_base()
def __getitem__(self, key):
return self.get(key)
def _get_files(self, name):
ret = []
if self._underlay is not None:
ret.append(os.path.join(self._underlay, name))
ret.append(os.path.join('debian/arch', name))
return ret
return [os.path.join(i, name) for i in self._dirs if i]
def _read_arch(self, arch):
files = self._get_files("%s/%s" % (arch, self.config_name))
@ -57,12 +55,17 @@ class config_reader(dict):
for section in iter(config):
real = list(section)
# TODO
if real[-1] in subarches:
real[0:0] = ['base', arch]
elif real[-1] in flavours:
real[0:0] = ['base', arch, 'none']
else:
real[0:] = [real.pop(), arch]
real[0:0] = [real.pop()]
if real[-1] in flavours:
real[1:1] = [arch, 'none']
else:
real[1:1] = [arch]
real = tuple(real)
s = self.get(real, {})
s.update(config[section])
@ -151,11 +154,6 @@ class config_reader(dict):
ret = {}
for i in xrange(0, len(args) + 1):
ret.update(self.get(tuple([section] + list(args[:i])), {}))
if section == 'base':
for i in ('abiname', 'arches', 'flavours', 'subarches'):
try:
del ret[i]
except KeyError: pass
return ret
def sections(self):

View File

@ -81,6 +81,25 @@ $
ret['source_upstream'] = ret['upstream']
return ret
class package_description(object):
__slots__ = "short", "long"
def __init__(self, value = None):
if value is not None:
self.short, long = value.split ("\n", 1)
self.long = long.split ("\n.\n")
else:
self.short = None
self.long = []
def __str__(self):
ret = self.short + '\n'
w = utils.wrap(width = 74, fix_sentence_endings = True)
pars = []
for i in self.long:
pars.append('\n '.join(w.wrap(i)))
return self.short + '\n ' + '\n .\n '.join(pars)
class package_relation(object):
__slots__ = "name", "version", "arches"
@ -183,12 +202,14 @@ class package(dict):
('Suggests', package_relation_list),
('Replaces', package_relation_list),
('Conflicts', package_relation_list),
('Description', utils.field_string),
('Description', package_description),
))
def __setitem__(self, key, value):
try:
value = self._fields[key](value)
cls = self._fields[key]
if not isinstance(value, cls):
value = cls(value)
except KeyError: pass
super(package, self).__setitem__(key, value)

View File

@ -14,9 +14,9 @@ class packages_list(sorted_dict):
class gencontrol(object):
def __init__(self, underlay = None):
self.changelog = read_changelog()
self.config = config_reader(underlay)
self.config = config_reader(["debian/arch", underlay])
self.templates = templates()
self.version, self.abiname, self.kpkg_abiname, self.changelog_vars = self.process_changelog({})
self.version, self.abiname, self.changelog_vars = self.process_changelog({})
def __call__(self):
packages = packages_list()
@ -37,18 +37,23 @@ class gencontrol(object):
makeflags = {
'VERSION': self.version['version'],
'SOURCE_UPSTREAM': self.version['source_upstream'],
'SOURCE_VERSION': self.version['source'],
'UPSTREAM_VERSION': self.version['upstream'],
'SOURCEVERSION': self.version['source'],
'UPSTREAMVERSION': self.version['upstream'],
'ABINAME': self.abiname,
'KPKG_ABINAME': self.kpkg_abiname,
'REVISIONS': ' '.join([i['Version']['debian'] for i in self.changelog[::-1]]),
}
vars = self.changelog_vars.copy()
self.do_main_setup(vars, makeflags)
self.do_main_packages(packages)
self.do_main_makefile(makefile, makeflags)
for arch in iter(self.config['base',]['arches']):
self.do_arch(packages, makefile, arch, self.changelog_vars.copy(), makeflags.copy())
self.do_arch(packages, makefile, arch, vars.copy(), makeflags.copy())
def do_main_setup(self, vars, makeflags):
pass
def do_main_makefile(self, makefile, makeflags):
makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])
@ -89,6 +94,7 @@ class gencontrol(object):
def do_arch(self, packages, makefile, arch, vars, makeflags):
config_entry = self.config['base', arch]
vars.update(config_entry)
vars.update(self.config['image', arch])
if not config_entry.get('available', True):
for i in ('binary-arch', 'build', 'setup'):
@ -97,7 +103,10 @@ class gencontrol(object):
extra = {}
makeflags['ARCH'] = arch
self.do_arch_makeflags(makeflags, arch)
vars['localversion'] = vars['abiname']
self.do_arch_setup(vars, makeflags, arch)
self.do_arch_makefile(makefile, arch, makeflags)
self.do_arch_packages(packages, makefile, arch, vars, makeflags, extra)
@ -106,7 +115,7 @@ class gencontrol(object):
self.do_arch_packages_post(packages, makefile, arch, vars, makeflags, extra)
def do_arch_makeflags(self, makeflags, arch):
def do_arch_setup(self, vars, makeflags, arch):
pass
def do_arch_makefile(self, makefile, arch, makeflags):
@ -121,22 +130,22 @@ class gencontrol(object):
pass
def do_subarch(self, packages, makefile, arch, subarch, vars, makeflags, extra):
if subarch == 'none':
vars['subarch'] = ''
else:
vars['subarch'] = '-%s' % subarch
config_entry = self.config['base', arch, subarch]
vars.update(config_entry)
vars.update(self.config.get(('image', arch, subarch), {}))
makeflags['SUBARCH'] = subarch
self.do_subarch_makeflags(makeflags, arch, subarch)
if subarch != 'none':
vars['localversion'] += '-' + subarch
self.do_subarch_setup(vars, makeflags, arch, subarch)
self.do_subarch_makefile(makefile, arch, subarch, makeflags)
self.do_subarch_packages(packages, makefile, arch, subarch, vars, makeflags, extra)
for flavour in config_entry['flavours']:
self.do_flavour(packages, makefile, arch, subarch, flavour, vars.copy(), makeflags.copy(), extra)
def do_subarch_makeflags(self, makeflags, arch, subarch):
def do_subarch_setup(self, vars, makeflags, arch, subarch):
pass
def do_subarch_makefile(self, makefile, arch, subarch, makeflags):
@ -151,8 +160,8 @@ class gencontrol(object):
def do_flavour(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
config_entry = self.config['base', arch, subarch, flavour]
vars.update(config_entry)
vars.update(self.config.get(('image', arch, subarch, flavour), {}))
vars['flavour'] = flavour
if not vars.has_key('class'):
warnings.warn('No class entry in config for flavour %s, subarch %s, arch %s' % (flavour, subarch, arch), DeprecationWarning)
vars['class'] = '%s-class' % flavour
@ -169,16 +178,17 @@ class gencontrol(object):
packages['source']['Build-Depends'].extend(relations_compiler)
makeflags['FLAVOUR'] = flavour
self.do_flavour_makeflags(makeflags, arch, subarch, flavour)
vars['localversion'] += '-' + flavour
self.do_flavour_setup(vars, makeflags, arch, subarch, flavour)
self.do_flavour_makefile(makefile, arch, subarch, flavour, makeflags)
self.do_flavour_packages(packages, makefile, arch, subarch, flavour, vars, makeflags, extra)
def do_flavour_makeflags(self, makeflags, arch, subarch, flavour):
def do_flavour_setup(self, vars, makeflags, arch, subarch, flavour):
config_entry = self.config.merge('base', arch, subarch, flavour)
for i in (
('compiler', 'COMPILER'),
('kernel-arch', 'KERNEL_ARCH')
('initrd', 'INITRD')
):
if config_entry.has_key(i[0]):
makeflags[i[1]] = config_entry[i[0]]
@ -192,19 +202,17 @@ class gencontrol(object):
pass
def process_changelog(self, in_vars):
ret = [None, None, None, None]
ret = [None, None, None]
ret[0] = version = self.changelog[0]['Version']
vars = in_vars.copy()
if version['modifier'] is not None:
ret[1] = vars['abiname'] = version['modifier']
ret[2] = ""
ret[1] = vars['abiname'] = ''
else:
ret[1] = vars['abiname'] = self.config['base',]['abiname']
ret[2] = "-%s" % vars['abiname']
vars['version'] = version['source']
ret[1] = vars['abiname'] = '-%s' % self.config['abiname',]['abiname']
vars['upstreamversion'] = version['upstream']
vars['version'] = version['version']
vars['major'] = version['major']
ret[3] = vars
ret[2] = vars
return ret
def process_relation(self, key, e, in_e, vars):
@ -223,14 +231,12 @@ class gencontrol(object):
e[key] = dep
def process_description(self, e, in_e, vars):
desc = in_e['Description']
desc_short, desc_long = desc.split ("\n", 1)
desc_pars = [self.substitute(i, vars) for i in desc_long.split ("\n.\n")]
desc_pars_wrapped = []
w = wrap(width = 74, fix_sentence_endings = True)
for i in desc_pars:
desc_pars_wrapped.append(w.fill(i))
e['Description'] = "%s\n%s" % (self.substitute(desc_short, vars), '\n.\n'.join(desc_pars_wrapped))
in_desc = in_e['Description']
desc = in_desc.__class__()
desc.short = self.substitute(in_desc.short, vars)
for i in in_desc.long:
desc.long.append(self.substitute(i, vars))
e['Description'] = desc
def process_package(self, in_entry, vars):
e = package()

View File

@ -99,6 +99,8 @@ class templates(dict):
while True:
e = debian.package()
last = None
lines = []
while True:
line = f.readline()
if not line:
@ -109,13 +111,17 @@ class templates(dict):
if line[0] in ' \t':
if not last:
raise ValueError('Continuation line seen before first header')
e[last] += '\n' + line.lstrip()
lines.append(line.lstrip())
continue
if last:
e[last] = '\n'.join(lines)
i = line.find(':')
if i < 0:
raise ValueError("Not a header, not a continuation: ``%s''" % line)
last = line[:i]
e[last] = line[i+1:].lstrip()
lines = [line[i+1:].lstrip()]
if last:
e[last] = '\n'.join(lines)
if not e:
break

32
debian/rules.real vendored
View File

@ -33,11 +33,11 @@ include debian/rules.defs
# in Makefile.inc. @flavour@ in the expressions is going to be
# replaced by the flavour for which the command is run.
#
kpkg_image := make-kpkg --append-to-version '$(KPKG_ABINAME)$(LOCALVERSION)'
kpkg_image := make-kpkg --append-to-version '$(ABINAME)$(LOCALVERSION)'
kpkg_image += --arch '$(ARCH)'
kpkg_image += --stem linux
ifneq ($(INITRD),no)
kpkg_image += --initrd
ifneq ($(INITRAMFS),False)
kpkg_image += --initrd
endif
ifdef KPKG_SUBARCH
kpkg_image += --subarch '$(KPKG_SUBARCH)'
@ -80,17 +80,17 @@ $(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(basedir)/config.$(FLAVOUR)
@echo "Generating configuration file $@:"
ocaml debian/bin/kconfig.ml -b "debian/arch" -a "$(ARCH)" -s "$(SUBARCH)" -f "$(FLAVOUR)" > '$@'
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION)
$(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2: $(STAMPS_DIR)/source
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: DIR = $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION)
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: $(STAMPS_DIR)/source
rm -rf '$@' '$(DIR)'
cp -al '$(SOURCE_DIR)' '$(DIR)'
chmod -R u+rw,go=rX '$(DIR)'
cd '$(BUILD_DIR)'; tar -cjf 'linux-source-$(UPSTREAM_VERSION).tar.bz2' 'linux-source-$(UPSTREAM_VERSION)'
cd '$(BUILD_DIR)'; tar -cjf 'linux-source-$(UPSTREAMVERSION).tar.bz2' 'linux-source-$(UPSTREAMVERSION)'
rm -rf '$(DIR)'
define patch_cmd
cd '$(DIR)'; python2.4 '$(CURDIR)/debian/bin/apply.py' --overwrite-home='$(CURDIR)/debian/patches' --overwrite-source='$(SOURCE_VERSION)' --overwrite-revisions='$(REVISIONS)'
cd '$(DIR)'; python2.4 '$(CURDIR)/debian/bin/apply.py' --overwrite-home='$(CURDIR)/debian/patches' --overwrite-source='$(SOURCEVERSION)' --overwrite-revisions='$(REVISIONS)'
endef
srcfiles := $(filter-out debian, $(wildcard * .[^.]*))
@ -185,7 +185,7 @@ install-dummy:
dh_clean -d -k
$(MAKE) -f debian/rules.real install-base
install-header-$(ARCH)-$(SUBARCH): PACKAGE_NAME = linux-headers-$(VERSION)-$(ABINAME)$(LOCALVERSION_HEADERS)
install-header-$(ARCH)-$(SUBARCH): PACKAGE_NAME = linux-headers-$(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION_HEADERS)
install-header-$(ARCH)-$(SUBARCH): DH_OPTIONS = -p$(PACKAGE_NAME)
install-header-$(ARCH)-$(SUBARCH): BASE_DIR = /usr/src/$(PACKAGE_NAME)
install-header-$(ARCH)-$(SUBARCH): SOURCE_DIR = $(BUILD_DIR)/source-$(ARCH)-$(SUBARCH)
@ -214,9 +214,9 @@ install-header-$(ARCH)-$(SUBARCH): $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
cpio -pd --preserve-modification-time $(DIR)
$(MAKE) -f debian/rules.real install-base
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): REAL_VERSION = $(VERSION)-$(ABINAME)$(LOCALVERSION)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_NAME = linux-headers-$(REAL_VERSION)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_NAME_HEADERS = linux-headers-$(VERSION)-$(ABINAME)$(LOCALVERSION_HEADERS)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): PACKAGE_NAME_HEADERS = linux-headers-$(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION_HEADERS)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): DH_OPTIONS = -p$(PACKAGE_NAME)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): BASE_DIR = /usr/src/$(PACKAGE_NAME)
install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): SOURCE_DIR = $(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
@ -232,7 +232,7 @@ install-header-$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(STAMPS_DIR)/build-$(ARCH)-$(SUBA
mkdir -p "${DIR}/include"
cp -a ${SOURCE_DIR}/{.config,Module.symvers} "${DIR}"
# TODO
echo -${KPKG_ABINAME}$(LOCALVERSION) > "${DIR}/localversion"
echo $(ABINAME)$(LOCALVERSION) > "${DIR}/localversion"
cd ${SOURCE_DIR}; \
find . -mindepth 1 -maxdepth 1 \
@ -297,7 +297,7 @@ install-headers-all:
dh_python $(DH_OPTIONS) -V 2.4 /usr/src/linux-headers-$(VERSION)/lib/python
$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): REAL_VERSION = $(VERSION)-$(ABINAME)$(LOCALVERSION)
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): REAL_VERSION = $(UPSTREAMVERSION)$(ABINAME)$(LOCALVERSION)
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): PACKAGE_NAME = linux-image-$(REAL_VERSION)
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): PACKAGE_DIR = $(CURDIR)/debian/$(PACKAGE_NAME)
install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE): SOURCE_DIR=$(BUILD_DIR)/build-$(ARCH)-$(SUBARCH)-$(FLAVOUR)
@ -325,7 +325,7 @@ install-image-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-plain: $(STAMPS_DIR)/build-$(ARCH)-$
dh_testroot
dh_clean -d -k
dh_installdirs 'boot'
cp '$(SOURCE_DIR)/vmlinuz' $(PACKAGE_DIR)/boot/vmlinuz-$(VERSION)-$(ABINAME)$(LOCALVERSION)
cp '$(SOURCE_DIR)/vmlinuz' $(PACKAGE_DIR)/boot/vmlinuz-$(REAL_VERSION)
cd '$(SOURCE_DIR)'; $(setup_env) make modules_install ARCH=$(KERNEL_ARCH) INSTALL_MOD_PATH=$(PACKAGE_DIR)
$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
@ -344,7 +344,7 @@ install-patch:
sed \
-e 's,@home@,$(pbase)/debian,' \
-e 's,@revisions@,$(REVISIONS),' \
-e 's,@source@,$(SOURCE_VERSION),' \
-e 's,@source@,$(SOURCEVERSION),' \
debian/bin/apply.py > '$(pfull)/apply/debian'
sed -e 's/@upstream@/$(SOURCE_UPSTREAM)/g' debian/bin/unpatch > '$(pfull)/unpatch/debian'
chmod 755 '$(pfull)/apply/debian' '$(pfull)/unpatch/debian'
@ -353,7 +353,7 @@ install-patch:
$(MAKE) -f debian/rules.real install-base DH_OPTIONS='$(DH_OPTIONS)'
install-source: DH_OPTIONS = -plinux-source-$(VERSION)
install-source: $(BUILD_DIR)/linux-source-$(UPSTREAM_VERSION).tar.bz2
install-source: $(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2
dh_testdir
dh_testroot
dh_install $(DH_OPTIONS) '$<' /usr/src

View File

@ -1,9 +1,9 @@
Package: linux-headers-@version@
Section: devel
Priority: optional
Provides: linux-headers-@version@-@abiname@-all, linux-headers-@major@-all
Provides: linux-headers-@upstreamversion@@abiname@-all, linux-headers-@major@-all
Depends: ${kernel:Depends}
Description: All header files for Linux kernel @version@
This package depends against all architecture-specific kernel header files
for Linux kernel version @version@, generally used for building out-of-tree
for Linux kernel version @upstreamversion@, generally used for building out-of-tree
kernel modules.

View File

@ -1,15 +1,15 @@
Package: linux-headers-@version@-@abiname@@subarch@-@flavour@
Package: linux-headers-@upstreamversion@@abiname@@localversion@
Section: devel
Priority: optional
Depends: linux-headers-@version@-@abiname@@subarch@ (= ${Source-Version})
Depends: linux-headers-@upstreamversion@@abiname@@localversion_headers@ (= ${Source-Version})
Provides: linux-headers, linux-headers-@major@
Description: Header files for Linux kernel @version@ on @class@ machines
This package provides the architecture-specific kernel header files
for Linux kernel @version@ on @longclass@ machines, generally
used for building out-of-tree kernel modules. These files are going to be
installed into /usr/src/linux-headers-@version@-@abiname@@subarch@-@flavour@, and can
installed into /usr/src/linux-headers-@upstreamversion@@abiname@@localversion@, and can
be used for building modules that load into the kernel provided by the
linux-image-@version@-@abiname@@subarch@-@flavour@ package.
linux-image-@upstreamversion@@abiname@@localversion@ package.
.
This packages is produced using an updated kernel packaging system
and replaces older kernel-headers packages

View File

@ -1,7 +1,7 @@
Package: linux-headers-@major@@subarch@-@flavour@
Package: linux-headers-@major@@localversion@
Section: devel
Priority: optional
Depends: linux-headers-@version@-@abiname@@subarch@-@flavour@ (= ${Source-Version})
Depends: linux-headers-@upstreamversion@@abiname@@localversion@ (= ${Source-Version})
Provides: linux-headers, linux-headers-@major@
Description: Architecture-specific header files for Linux kernel @major@ on @class@ machines
This package depends on the architecture-specific header files for the latest

View File

@ -1,4 +1,4 @@
Package: linux-headers-@version@-@abiname@@subarch@
Package: linux-headers-@upstreamversion@@abiname@@localversion_headers@
Section: devel
Priority: optional
Provides: linux-headers, linux-headers-@major@
@ -6,10 +6,10 @@ Description: Common header files for Linux kernel @version@
This package provides the (sub)architecture-specific common kernel header files
for Linux kernel version @version@, generally used for building out-of-tree
kernel modules. To obtain a complete set of headers you also need to install
the linux-headers-@version@-@abiname@@subarch@-(flavour) package, matching the
the linux-headers-@upstreamversion@@abiname@-(flavour) package, matching the
flavour of the kernel you intend the build for. To obtain such a set for the
currently running kernel it is sufficient to run a command
.
apt-get install linux-headers-$(uname -r)
.
and it will be unpacked in /usr/src/linux-headers-@version@-@abiname@@subarch@-(flavour).
and it will be unpacked in /usr/src/linux-headers-@upstreamversion@@abiname@-(flavour).

View File

@ -1,4 +1,4 @@
Package: linux-image-@version@-@abiname@@subarch@-@flavour@
Package: linux-image-@upstreamversion@@abiname@@localversion@
Section: base
Priority: optional
Provides: linux-image, linux-image-@major@

View File

@ -1,15 +1,15 @@
Package: linux-image@subarch@-@flavour@
Package: linux-image@localversion@
Section: base
Priority: optional
Depends: linux-image-@major@@subarch@-@flavour@ (= ${Source-Version})
Depends: linux-image-@major@@localversion@ (= ${Source-Version})
Description: Linux kernel image on @class@ machines
This package depends on the latest binary image for Linux kernel on
@longclass@ machines.
Package: linux-image-@major@@subarch@-@flavour@
Package: linux-image-@major@@localversion@
Section: base
Priority: optional
Depends: linux-image-@version@-@abiname@@subarch@-@flavour@ (= ${Source-Version})
Depends: linux-image-@upstreamversion@@abiname@@localversion@ (= ${Source-Version})
Description: Linux kernel @major@ image on @class@ machines
This package depends on the latest binary image for Linux kernel @major@
on @longclass@ machines.