From cbf647997c5fbbf1076e89a0cd44bef2e785f176 Mon Sep 17 00:00:00 2001 From: Bastian Blank Date: Wed, 21 Nov 2012 17:24:33 +0000 Subject: [PATCH] debian/bin/gencontrol.py: Bail out if disable requests can't be honored. svn path=/dists/trunk/linux/; revision=19516 --- debian/bin/gencontrol.py | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index f3ee61c1a..6c8c38214 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -122,9 +122,12 @@ class Gencontrol(Base): ["$(MAKE) -f debian/rules.real install-libc-dev_%s %s" % (arch, makeflags)]) - if self.changelog[0].distribution == 'UNRELEASED' and os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'): - import warnings - warnings.warn(u'Disable building of installer modules on request (DEBIAN_KERNEL_DISABLE_INSTALLER set)') + if os.getenv('DEBIAN_KERNEL_DISABLE_INSTALLER'): + if self.changelog[0].distribution == 'UNRELEASED': + import warnings + warnings.warn(u'Disable installer modules on request (DEBIAN_KERNEL_DISABLE_INSTALLER set)') + else: + raise RuntimeError(u'Unable to disable installer modules in release build (DEBIAN_KERNEL_DISABLE_INSTALLER set)') else: # Add udebs using kernel-wedge installer_def_dir = 'debian/installer' @@ -292,10 +295,13 @@ class Gencontrol(Base): build_debug = config_entry_build.get('debug-info') - if build_debug and self.changelog[0].distribution == 'UNRELEASED' and os.getenv('DEBIAN_KERNEL_DISABLE_DEBUG'): - import warnings - warnings.warn(u'Disable building of debug infos on request (DEBIAN_KERNEL_DISABLE_DEBUG set)') - build_debug = False + if os.getenv('DEBIAN_KERNEL_DISABLE_DEBUG'): + if self.changelog[0].distribution == 'UNRELEASED': + import warnings + warnings.warn(u'Disable debug infos on request (DEBIAN_KERNEL_DISABLE_DEBUG set)') + build_debug = False + else: + raise RuntimeError(u'Unable to disable debug infos in release build (DEBIAN_KERNEL_DISABLE_DEBUG set)') if build_debug: makeflags['DEBUG'] = True