diff --git a/debian/bin/gencontrol.py b/debian/bin/gencontrol.py index 6e590396d..5e01ace1c 100755 --- a/debian/bin/gencontrol.py +++ b/debian/bin/gencontrol.py @@ -268,6 +268,12 @@ class Gencontrol(Base): extra['headers_arch_depends'].append('%s (= ${binary:Version})' % packages_own[-1]['Package']) 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)') + build_debug = False + if build_debug: makeflags['DEBUG'] = True packages_own.extend(self.process_packages(self.templates['control.image-dbg'], vars))