Factor out debug info disable flag

This commit is contained in:
Bastian Blank 2020-08-20 10:19:15 +02:00 committed by Salvatore Bonaccorso
parent 4899f5039c
commit 413fadb4aa
1 changed files with 2 additions and 12 deletions

View File

@ -59,6 +59,7 @@ class Gencontrol(Base):
}
env_flags = [
('DEBIAN_KERNEL_DISABLE_DEBUG', 'disable_debug', 'debug infos'),
('DEBIAN_KERNEL_DISABLE_INSTALLER', 'disable_installer', 'installer modules'),
]
@ -487,18 +488,7 @@ class Gencontrol(Base):
build_debug = config_entry_build.get('debug-info')
if os.getenv('DEBIAN_KERNEL_DISABLE_DEBUG'):
if self.changelog[0].distribution == 'UNRELEASED':
import warnings
warnings.warn('Disable debug infos on request '
'(DEBIAN_KERNEL_DISABLE_DEBUG set)')
build_debug = False
else:
raise RuntimeError(
'Unable to disable debug infos in release build '
'(DEBIAN_KERNEL_DISABLE_DEBUG set)')
if build_debug:
if not self.disable_debug:
makeflags['DEBUG'] = True
packages_own.extend(self.process_packages(
self.templates['control.image-dbg'], vars))