* debian/bin/kconfig.py: Rework arguments check.
* debian/rules.real: Retrieve list of files from kconfig.py. svn path=/dists/trunk/linux-2.6/; revision=7371
This commit is contained in:
parent
eb653c82dc
commit
112e4c858d
|
@ -1,13 +1,24 @@
|
|||
#!/usr/bin/env python2.4
|
||||
|
||||
import sys
|
||||
import optparse, os.path, sys
|
||||
from debian_linux.abi import *
|
||||
from debian_linux.config import *
|
||||
from debian_linux.kconfig import *
|
||||
|
||||
class checker(object):
|
||||
def __init__(self, arch, subarch, flavour):
|
||||
config = config_reader_arch(["debian/arch"])
|
||||
parser = optparse.OptionParser()
|
||||
parser.add_option('-b', '--base', dest = 'base', default = "debian/arch")
|
||||
parser.add_option('-o', '--output', dest = 'output')
|
||||
|
||||
def __init__(self):
|
||||
options, args = self.parser.parse_args()
|
||||
|
||||
self.base = options.base
|
||||
self.output = options.output
|
||||
|
||||
arch, subarch, flavour = args
|
||||
|
||||
config = config_reader_arch([self.base])
|
||||
|
||||
self.config = self._get_config(config, ["config"])
|
||||
self.config_arch = self._get_config(config, ["%s/config" % arch], arch)
|
||||
|
@ -18,18 +29,21 @@ class checker(object):
|
|||
self.config_subarch = self._get_config(config, ["%s/%s/config" % (arch, subarch)], arch, subarch)
|
||||
self.config_flavour = self._get_config(config, ["%s/%s/config.%s" % (arch, subarch, flavour)], arch, subarch, flavour)
|
||||
|
||||
def __call__(self, out):
|
||||
def __call__(self):
|
||||
config = []
|
||||
config.extend(self.config)
|
||||
config.extend(self.config_arch)
|
||||
config.extend(self.config_subarch)
|
||||
config.extend(self.config_flavour)
|
||||
config = [os.path.join(self.base, c) for c in config]
|
||||
|
||||
kconfig = kconfigfile()
|
||||
for c in config:
|
||||
kconfig.read(file("debian/arch/%s" % c))
|
||||
|
||||
out.write(str(kconfig))
|
||||
if self.output:
|
||||
kconfig = kconfigfile()
|
||||
for c in config:
|
||||
kconfig.read(file(c))
|
||||
file(self.output, "w").write(str(kconfig))
|
||||
else:
|
||||
print '\n'.join(config)
|
||||
|
||||
def _get_config(self, config, default, *entry_name):
|
||||
entry_real = ('image',) + entry_name
|
||||
|
@ -42,4 +56,4 @@ class checker(object):
|
|||
return configs
|
||||
|
||||
if __name__ == '__main__':
|
||||
sys.exit(checker(*sys.argv[1:])(sys.stdout))
|
||||
sys.exit(checker()())
|
||||
|
|
|
@ -77,18 +77,9 @@ setup-flavour: $(STAMPS_DIR)/setup-$(ARCH)-$(SUBARCH)-$(FLAVOUR)-$(TYPE)
|
|||
source-arch: $(STAMPS_DIR)/source
|
||||
source-subarch: $(STAMPS_DIR)/source-$(ARCH)-$(SUBARCH)
|
||||
|
||||
#
|
||||
# Generates the kernel config file for a subarch by merging
|
||||
# the arch-independent config file (arch/config),
|
||||
# arch-specific config file (arch/$(karch)/config),
|
||||
# and subarch specific one (arch/$(karch)/$(subarch)/config).
|
||||
#
|
||||
config_common = debian/arch/config debian/arch/$(ARCH)/config
|
||||
ifneq ($(SUBARCH),none)
|
||||
config_common += debian/arch/$(ARCH)/$(SUBARCH)/config
|
||||
endif
|
||||
$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(basedir)/config.$(FLAVOUR) $(config_common)
|
||||
python2.4 debian/bin/kconfig.py "$(ARCH)" "$(SUBARCH)" "$(FLAVOUR)" > '$@'
|
||||
CONFIGS = $(shell PYTHONPATH = $(CURDIR)/debian/lib/python python2.4 debian/bin/kconfig.py "$(ARCH)" "$(SUBARCH)" "$(FLAVOUR)")
|
||||
$(BUILD_DIR)/config.$(ARCH)-$(SUBARCH)-$(FLAVOUR): $(CONFIGS)
|
||||
python2.4 debian/bin/kconfig.py -o '$@' "$(ARCH)" "$(SUBARCH)" "$(FLAVOUR)"
|
||||
|
||||
$(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)
|
||||
|
|
Loading…
Reference in New Issue