* debian/bin/gencontrol.py
- Add default settings for config and template dirs. - Support more than one config dir. * debian/bin/kconfig.py: Don't longer prefix files. * debian/lib/python/debian_linux/gencontrol.py: Drop default config and template dirs. * debian/rules.real: Don't prefix config files. svn path=/dists/trunk/linux-2.6/; revision=9308
This commit is contained in:
parent
5f0d29bcd9
commit
3858ead071
|
@ -6,9 +6,10 @@ from debian_linux.gencontrol import Gencontrol as Base
|
||||||
from debian_linux.debian import *
|
from debian_linux.debian import *
|
||||||
|
|
||||||
class Gencontrol(Base):
|
class Gencontrol(Base):
|
||||||
def __init__(self):
|
def __init__(self, config_dirs = ["debian/config"], template_dirs = ["debian/templates"]):
|
||||||
super(Gencontrol, self).__init__()
|
super(Gencontrol, self).__init__(config_dirs = config_dirs, template_dirs = template_dirs)
|
||||||
self.process_changelog()
|
self.process_changelog()
|
||||||
|
self.config_dirs = config_dirs
|
||||||
|
|
||||||
def do_main_setup(self, vars, makeflags, extra):
|
def do_main_setup(self, vars, makeflags, extra):
|
||||||
super(Gencontrol, self).do_main_setup(vars, makeflags, extra)
|
super(Gencontrol, self).do_main_setup(vars, makeflags, extra)
|
||||||
|
@ -188,19 +189,25 @@ class Gencontrol(Base):
|
||||||
return entry.get('configs', None)
|
return entry.get('configs', None)
|
||||||
|
|
||||||
def check_config_default(fail, f):
|
def check_config_default(fail, f):
|
||||||
f1 = "debian/config/" + f
|
for d in self.config_dirs[::-1]:
|
||||||
if os.path.exists(f1):
|
f1 = d + '/' + f
|
||||||
return [f]
|
if os.path.exists(f1):
|
||||||
|
return [f1]
|
||||||
if fail:
|
if fail:
|
||||||
raise RuntimeError("%s unavailable" % f)
|
raise RuntimeError("%s unavailable" % f)
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def check_config_files(files):
|
def check_config_files(files):
|
||||||
|
ret = []
|
||||||
for f in files:
|
for f in files:
|
||||||
f1 = "debian/config/" + f
|
for d in self.config_dirs[::-1]:
|
||||||
if not os.path.exists(f1):
|
f1 = d + '/' + f
|
||||||
|
if os.path.exists(f1):
|
||||||
|
ret.append(f1)
|
||||||
|
break
|
||||||
|
else:
|
||||||
raise RuntimeError("%s unavailable" % f)
|
raise RuntimeError("%s unavailable" % f)
|
||||||
return files
|
return ret
|
||||||
|
|
||||||
def check_config(default, fail, *entry_name):
|
def check_config(default, fail, *entry_name):
|
||||||
configs = get_config(*entry_name)
|
configs = get_config(*entry_name)
|
||||||
|
@ -208,7 +215,7 @@ class Gencontrol(Base):
|
||||||
return check_config_default(fail, default)
|
return check_config_default(fail, default)
|
||||||
return check_config_files(configs)
|
return check_config_files(configs)
|
||||||
|
|
||||||
kconfig = ['config']
|
kconfig = check_config('config', True)
|
||||||
kconfig.extend(check_config("featureset-%s/config" % featureset, False, None, featureset))
|
kconfig.extend(check_config("featureset-%s/config" % featureset, False, None, featureset))
|
||||||
kconfig.extend(check_config("%s/config" % arch, True, arch))
|
kconfig.extend(check_config("%s/config" % arch, True, arch))
|
||||||
kconfig.extend(check_config("%s/config.%s" % (arch, flavour), False, arch, None, flavour))
|
kconfig.extend(check_config("%s/config.%s" % (arch, flavour), False, arch, None, flavour))
|
||||||
|
|
|
@ -4,8 +4,6 @@ import optparse, os.path, sys
|
||||||
from debian_linux.kconfig import *
|
from debian_linux.kconfig import *
|
||||||
|
|
||||||
def merge(output, *config):
|
def merge(output, *config):
|
||||||
config = [os.path.join('debian/config', c) for c in config]
|
|
||||||
|
|
||||||
kconfig = KconfigFile()
|
kconfig = KconfigFile()
|
||||||
for c in config:
|
for c in config:
|
||||||
kconfig.read(file(c))
|
kconfig.read(file(c))
|
||||||
|
|
|
@ -24,7 +24,7 @@ class MakeFlags(dict):
|
||||||
class Gencontrol(object):
|
class Gencontrol(object):
|
||||||
makefile_targets = ('binary-arch', 'build', 'setup', 'source')
|
makefile_targets = ('binary-arch', 'build', 'setup', 'source')
|
||||||
|
|
||||||
def __init__(self, config_dirs = ["debian/config"], template_dirs = ["debian/templates"]):
|
def __init__(self, config_dirs, template_dirs):
|
||||||
self.config = ConfigReaderCore(config_dirs)
|
self.config = ConfigReaderCore(config_dirs)
|
||||||
self.templates = Templates(template_dirs)
|
self.templates = Templates(template_dirs)
|
||||||
|
|
||||||
|
|
|
@ -68,7 +68,7 @@ setup-flavour: $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
|
||||||
source-arch: $(STAMPS_DIR)/source
|
source-arch: $(STAMPS_DIR)/source
|
||||||
source-featureset: $(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET)
|
source-featureset: $(STAMPS_DIR)/source_$(ARCH)_$(FEATURESET)
|
||||||
|
|
||||||
$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(foreach t,$(KCONFIG),debian/config/$(t))
|
$(BUILD_DIR)/config.$(ARCH)_$(FEATURESET)_$(FLAVOUR): $(KCONFIG)
|
||||||
python2.4 debian/bin/kconfig.py '$@' $(KCONFIG)
|
python2.4 debian/bin/kconfig.py '$@' $(KCONFIG)
|
||||||
|
|
||||||
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
|
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
|
||||||
|
|
Loading…
Reference in New Issue