[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#436260: Acknowledgement (linux-support-2.6.22-1: Support for exernal module packages broken)

tag 436260 + patch

The enclosed gencontrol.py for use in module packages probably fixes
interoperation with module packages for current kernel versions.  It
appears to work for me but I have relatively little confidence in my
changes given that I don't particularly understand the changes that I'm
adapting for.

"You grabbed my hand and we fell into it, like a daydream - or a fever."
#!/usr/bin/env python2.4
import sys
sys.path.append(sys.argv[1] + "/lib/python")
from debian_linux.gencontrol import Gencontrol
from debian_linux.gencontrol import PackagesList
from debian_linux.config import *
from debian_linux.debian import *
from debian_linux.config import ConfigParser

class gencontrol(Gencontrol):
    def __init__(self, config):
        Gencontrol.__init__(self, config)
        self.process_config_version(ConfigParser({}, [sys.argv[1] + "/version"]))

    def __call__(self):
        packages = PackagesList()
        makefile = [('.NOTPARALLEL:', ())]

        self.do_main(packages, makefile)
        self.do_extra(packages, makefile)


    def do_main_packages(self, packages, extra):
        vars = self.vars

        main = self.templates["control.main"]
        packages.extend(self.process_packages(main, vars))

            ['linux-support-%s%s' % (self.version.upstream, self.abiname)]
            ['linux-headers-%s%s-all-%s [%s]' % (self.version.upstream, self.abiname, arch, arch)
            for arch in self.config['base',]['arches']],

    def do_flavour(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
        config_entry = self.config.merge('base', arch, subarch, flavour)
        if config_entry.get('modules', True) is False:

        Gencontrol.do_flavour(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra)

    def do_flavour_packages(self, packages, makefile, arch, subarch, flavour, vars, makeflags, extra):
        modules = self.templates["control.modules"]
        modules = self.process_packages(modules, vars)

        for package in modules:
            name = package['Package']
            if packages.has_key(name):
                package = packages.get(name)
                package['Architecture'] = [arch]

        makeflags_string = ' '.join(["%s='%s'" % i for i in makeflags.iteritems()])

        cmds_binary_arch = []
        cmds_binary_arch.append(("$(MAKE) -f debian/rules.real binary-arch-flavour %s" % makeflags_string,))
        cmds_build = []
        cmds_build.append(("$(MAKE) -f debian/rules.real build %s" % makeflags_string,))
        cmds_setup = []
        cmds_setup.append(("$(MAKE) -f debian/rules.real setup-flavour %s" % makeflags_string,))
        makefile.append(("binary-arch-%s-%s-%s-real:" % (arch, subarch, flavour), cmds_binary_arch))
        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_config_version(self, config):
        entry = config['version',]
        self.version = VersionLinux(entry['source'])
        self.abiname = entry['abiname']
        self.vars = self.process_version_linux(self.version, self.abiname)

if __name__ == '__main__':
    gencontrol(sys.argv[1] + "/arch")()

Attachment: signature.asc
Description: Digital signature

Reply to: