aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBastian Blank <bastian.blank@credativ.de>2020-08-20 10:17:41 +0200
committerBastian Blank <bastian.blank@credativ.de>2020-08-20 10:19:27 +0200
commit9b82c45d67dc4051cdf95ea22e1fafcb7e0a4d59 (patch)
treebdbc8b1e5db35ab1262a7b5485d308f0aa318801
parent8f1629b0236b2d8a16d2c933807482f2e69350d3 (diff)
downloadkernel_replicant_linux-9b82c45d67dc4051cdf95ea22e1fafcb7e0a4d59.tar.gz
kernel_replicant_linux-9b82c45d67dc4051cdf95ea22e1fafcb7e0a4d59.tar.bz2
kernel_replicant_linux-9b82c45d67dc4051cdf95ea22e1fafcb7e0a4d59.zip
Factor out installer modules disable flag
-rwxr-xr-xdebian/bin/gencontrol.py26
1 files changed, 16 insertions, 10 deletions
diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py
index d5ee79be11c8..d2e52654919c 100755
--- a/debian/bin/gencontrol.py
+++ b/debian/bin/gencontrol.py
@@ -58,6 +58,10 @@ class Gencontrol(Base):
}
}
+ env_flags = [
+ ('DEBIAN_KERNEL_DISABLE_INSTALLER', 'disable_installer', 'installer modules'),
+ ]
+
def __init__(self, config_dirs=["debian/config"],
template_dirs=["debian/templates"]):
super(Gencontrol, self).__init__(
@@ -67,6 +71,17 @@ class Gencontrol(Base):
self.process_changelog()
self.config_dirs = config_dirs
+ for env, attr, desc in self.env_flags:
+ setattr(self, attr, False)
+ if os.getenv(env):
+ if self.changelog[0].distribution == 'UNRELEASED':
+ import warnings
+ warnings.warn(f'Disable {desc} on request ({env} set)')
+ setattr(self, attr, True)
+ else:
+ raise RuntimeError(
+ 'Unable to disable {desc} in release build ({env} set)')
+
def _setup_makeflags(self, names, makeflags, data):
for src, dst, optional in names:
if src in data or not optional:
@@ -90,16 +105,7 @@ class Gencontrol(Base):
self.installer_packages = {}
- if os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'):
- if self.changelog[0].distribution == 'UNRELEASED':
- import warnings
- warnings.warn('Disable installer modules on request '
- '(DEBIAN_KERNEL_DISABLE_INSTALLER set)')
- else:
- raise RuntimeError(
- 'Unable to disable installer modules in release build '
- '(DEBIAN_KERNEL_DISABLE_INSTALLER set)')
- elif self.config.merge('packages').get('installer', True):
+ if not self.disable_installer and self.config.merge('packages').get('installer', True):
# Add udebs using kernel-wedge
kw_env = os.environ.copy()
kw_env['KW_DEFCONFIG_DIR'] = 'debian/installer'