* 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 *
|
||||
|
||||
class Gencontrol(Base):
|
||||
def __init__(self):
|
||||
super(Gencontrol, self).__init__()
|
||||
def __init__(self, config_dirs = ["debian/config"], template_dirs = ["debian/templates"]):
|
||||
super(Gencontrol, self).__init__(config_dirs = config_dirs, template_dirs = template_dirs)
|
||||
self.process_changelog()
|
||||
self.config_dirs = config_dirs
|
||||
|
||||
def do_main_setup(self, vars, makeflags, extra):
|
||||
super(Gencontrol, self).do_main_setup(vars, makeflags, extra)
|
||||
|
@ -188,19 +189,25 @@ class Gencontrol(Base):
|
|||
return entry.get('configs', None)
|
||||
|
||||
def check_config_default(fail, f):
|
||||
f1 = "debian/config/" + f
|
||||
if os.path.exists(f1):
|
||||
return [f]
|
||||
for d in self.config_dirs[::-1]:
|
||||
f1 = d + '/' + f
|
||||
if os.path.exists(f1):
|
||||
return [f1]
|
||||
if fail:
|
||||
raise RuntimeError("%s unavailable" % f)
|
||||
return []
|
||||
|
||||
def check_config_files(files):
|
||||
ret = []
|
||||
for f in files:
|
||||
f1 = "debian/config/" + f
|
||||
if not os.path.exists(f1):
|
||||
for d in self.config_dirs[::-1]:
|
||||
f1 = d + '/' + f
|
||||
if os.path.exists(f1):
|
||||
ret.append(f1)
|
||||
break
|
||||
else:
|
||||
raise RuntimeError("%s unavailable" % f)
|
||||
return files
|
||||
return ret
|
||||
|
||||
def check_config(default, fail, *entry_name):
|
||||
configs = get_config(*entry_name)
|
||||
|
@ -208,7 +215,7 @@ class Gencontrol(Base):
|
|||
return check_config_default(fail, default)
|
||||
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("%s/config" % arch, True, arch))
|
||||
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 *
|
||||
|
||||
def merge(output, *config):
|
||||
config = [os.path.join('debian/config', c) for c in config]
|
||||
|
||||
kconfig = KconfigFile()
|
||||
for c in config:
|
||||
kconfig.read(file(c))
|
||||
|
|
|
@ -24,7 +24,7 @@ class MakeFlags(dict):
|
|||
class Gencontrol(object):
|
||||
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.templates = Templates(template_dirs)
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ setup-flavour: $(STAMPS_DIR)/setup_$(ARCH)_$(FEATURESET)_$(FLAVOUR)_$(TYPE)
|
|||
source-arch: $(STAMPS_DIR)/source
|
||||
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)
|
||||
|
||||
$(BUILD_DIR)/linux-source-$(UPSTREAMVERSION).tar.bz2: SOURCE_DIR=$(BUILD_DIR)/source
|
||||
|
|
Loading…
Reference in New Issue