[diffoscope] 01/01: Don't crash when we can't find the debug file in a matching debug package

Jérémy Bobbio lunar at moszumanska.debian.org
Wed Jan 27 14:42:28 CET 2016

This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository diffoscope.

commit ab3afb29c95f5f5a055077349e005faa87ced553
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Wed Jan 27 13:41:16 2016 +0000

    Don't crash when we can't find the debug file in a matching debug package
    This repairs diffoscope for xserver-xorg.
 diffoscope/comparators/elf.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/diffoscope/comparators/elf.py b/diffoscope/comparators/elf.py
index 828e0f5..3e942f4 100644
--- a/diffoscope/comparators/elf.py
+++ b/diffoscope/comparators/elf.py
@@ -361,7 +361,11 @@ class ElfContainer(Container):
             logger.debug('Unable to find a matching debug package for Build Id %s', build_id)
         dbgsym_package = deb.container.dbgsym_build_id_map[build_id]
-        debug_file = dbgsym_package.as_container.data_tar.as_container.lookup_file('./usr/lib/debug/.build-id/{0}/{1}.debug'.format(build_id[0:2], build_id[2:]))
+        debug_file_path = './usr/lib/debug/.build-id/{0}/{1}.debug'.format(build_id[0:2], build_id[2:])
+        debug_file = dbgsym_package.as_container.data_tar.as_container.lookup_file(debug_file_path)
+        if not debug_file:
+            logger.debug('Unable to find the matching debug file %s in %s', debug_file_path, dbgsym_package)
+            return
         # Create a .debug directory and link the debug symbols there with the right name
         dest_path = os.path.join(os.path.dirname(self.source.path), '.debug', os.path.basename(debuglink))

Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git

More information about the diffoscope mailing list