Commit b2b61327 authored by Chris Lamb's avatar Chris Lamb 💬

Make --use-dbgsym a ternary operator to make it easier to totally disable....

Make --use-dbgsym a ternary operator to make it easier to totally disable. (re. #2)
parent 292895ca
Pipeline #41575 passed with stage
in 15 minutes
......@@ -491,6 +491,9 @@ class ElfContainer(Container):
@tool_required('objcopy')
def _install_debug_symbols(self):
if Config().use_dbgsym == 'no':
return
# Figure out if we are in a Debian package first
try:
deb = (
......@@ -511,7 +514,7 @@ class ElfContainer(Container):
# `Config().use_dbgsym`.
if (
not hasattr(deb.container.source, 'container')
and not Config().use_dbgsym
and Config().use_dbgsym != 'yes'
):
return
......
......@@ -63,7 +63,7 @@ class Config(object):
self.exclude_directory_metadata = 'no'
self.compute_visual_diffs = False
self.max_container_depth = 50
self.use_dbgsym = False
self.use_dbgsym = 'auto'
self.force_details = False
def __setattr__(self, k, v):
......
......@@ -371,10 +371,13 @@ def create_parser():
)
group3.add_argument(
'--use-dbgsym',
action='store_true',
help='Automatically use corresponding -dbgsym packages'
'when comparing .deb files. (default: %(default)s)',
default=Config().use_dbgsym,
metavar='WHEN',
default='auto',
choices=('no', 'auto', 'yes'),
help='When to automatically use corresponding -dbgsym packages when '
'comparing .deb files. WHEN is one of {%(choices)s}. Default: auto, '
'meaning yes if two .changes or .buildinfo files are specified, '
'otherwise no.',
)
group3.add_argument(
'--force-details',
......
......@@ -169,7 +169,7 @@ def dbgsym_dir2():
@pytest.fixture
def dbgsym_differences(monkeypatch, dbgsym_dir1, dbgsym_dir2):
monkeypatch.setattr(Config(), 'use_dbgsym', True)
monkeypatch.setattr(Config(), 'use_dbgsym', 'yes')
return dbgsym_dir1.compare(dbgsym_dir2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment