[Git][reproducible-builds/diffoscope][master] Don't look for adjacent -dbgsym package files automatically anymore to align...

Chris Lamb gitlab at salsa.debian.org
Wed Feb 6 17:22:18 CET 2019


Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
5ef24a6a by Chris Lamb at 2019-02-06T16:20:51Z
Don't look for adjacent -dbgsym package files automatically anymore to align better with default user expectations. The existing behaviour can be re-enabled by specifying the new `--use-dbgsym` flag. (Closes: #44, Debian:#920701)

- - - - -


4 changed files:

- diffoscope/comparators/elf.py
- diffoscope/config.py
- diffoscope/main.py
- tests/comparators/test_elf.py


Changes:

=====================================
diffoscope/comparators/elf.py
=====================================
@@ -25,6 +25,7 @@ import collections
 
 from diffoscope.exc import OutputParsingError
 from diffoscope.tools import get_tool_name, tool_required
+from diffoscope.config import Config
 from diffoscope.tempfiles import get_named_temporary_file
 from diffoscope.difference import Difference
 
@@ -468,7 +469,7 @@ class ElfContainer(Container):
             )
             raise OutputParsingError(command, self)
 
-        if not has_debug_symbols:
+        if not has_debug_symbols and Config().use_dbgsym:
             self._install_debug_symbols()
 
     @tool_required('objcopy')


=====================================
diffoscope/config.py
=====================================
@@ -63,6 +63,7 @@ class Config(object):
         self.exclude_directory_metadata = False
         self.compute_visual_diffs = False
         self.max_container_depth = 50
+        self.use_dbgsym = False
         self.force_details = False
 
     def __setattr__(self, k, v):


=====================================
diffoscope/main.py
=====================================
@@ -229,6 +229,10 @@ def create_parser():
                         'it in a report, and affects all types of output, '
                         'including --text and --json. (0 to disable, default: '
                         '%(default)s)', default=0)
+    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)
     group3.add_argument('--force-details', default=False, action='store_true',
                         help='Force recursing into the depths of file formats '
                         'even if files have the same content, only really '
@@ -437,6 +441,7 @@ def run_diffoscope(parsed_args):
     maybe_set_limit(Config(), parsed_args, "max_diff_block_lines_saved")
     maybe_set_limit(Config(), parsed_args, "max_diff_input_lines")
     Config().max_container_depth = parsed_args.max_container_depth
+    Config().use_dbgsym = parsed_args.use_dbgsym
     Config().force_details = parsed_args.force_details
     Config().fuzzy_threshold = parsed_args.fuzzy_threshold
     Config().new_file = parsed_args.new_file


=====================================
tests/comparators/test_elf.py
=====================================
@@ -162,7 +162,8 @@ def dbgsym_dir2():
 
 
 @pytest.fixture
-def dbgsym_differences(dbgsym_dir1, dbgsym_dir2):
+def dbgsym_differences(monkeypatch, dbgsym_dir1, dbgsym_dir2):
+    monkeypatch.setattr(Config(), 'use_dbgsym', True)
     return dbgsym_dir1.compare(dbgsym_dir2)
 
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/5ef24a6a9b424b7dd4906b185c43c0553e0f07c0

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/commit/5ef24a6a9b424b7dd4906b185c43c0553e0f07c0
You're receiving this email because of your account on salsa.debian.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20190206/b209b33f/attachment.html>


More information about the rb-commits mailing list