[Git][reproducible-builds/diffoscope][master] 2 commits: Also consider .aar files as APK files for the sake of diffoscope. (Closes: Debian:#1099632)

Chris Lamb (@lamby) gitlab at salsa.debian.org
Wed Mar 19 14:13:54 UTC 2025



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
75b82281 by Chris Lamb at 2025-03-19T13:48:17+00:00
Also consider .aar files as APK files for the sake of diffoscope. (Closes: Debian:#1099632)

- - - - -
d688b9a4 by Chris Lamb at 2025-03-19T14:12:10+00:00
Ensure all calls to out_check_output in the ELF comparator have the potential CalledProcessError exception caught. (Re: #398)

- - - - -


2 changed files:

- diffoscope/comparators/apk.py
- diffoscope/comparators/elf.py


Changes:

=====================================
diffoscope/comparators/apk.py
=====================================
@@ -238,7 +238,7 @@ class ApkFile(ZipFileBase):
     DESCRIPTION = "Android APK files"
     FILE_TYPE_HEADER_PREFIX = b"PK\x03\x04"
     FILE_TYPE_RE = re.compile(r"^(Android package|(Java|Zip) archive data)\b")
-    FILE_EXTENSION_SUFFIX = {".apk"}
+    FILE_EXTENSION_SUFFIX = {".apk", ".aar"}
     CONTAINER_CLASSES = [ApkContainer, ZipContainer]
 
     @property


=====================================
diffoscope/comparators/elf.py
=====================================
@@ -167,10 +167,14 @@ class ReadElfSection(Readelf):
     @staticmethod
     def base_options():
         if not hasattr(ReadElfSection, "_base_options"):
-            output = our_check_output(
-                [get_tool_name("readelf"), "--help"],
-                stderr=subprocess.DEVNULL,
-            ).decode("us-ascii", errors="replace")
+            try:
+                output = our_check_output(
+                    [get_tool_name("readelf"), "--help"],
+                    stderr=subprocess.DEVNULL,
+                ).decode("us-ascii", errors="replace")
+            except subprocess.CalledProcessError as e:
+                logger.warning("Unable to get readelf options", e)
+                output = ""
 
             ReadElfSection._base_options = []
             for x in ("--decompress",):
@@ -513,7 +517,10 @@ class ElfContainer(DecompilableContainer):
             raise OutputParsingError(command, self)
 
         if not has_debug_symbols:
-            self._install_debug_symbols()
+            try:
+                self._install_debug_symbols()
+            except subprocess.CalledProcessError as e:
+                logger.warning("Error when installing ELF debug symbols", e)
 
         if has_build_id:
             try:



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/a49c25d85869eba64d90b3b4c6a64eca4292a39e...d688b9a4ced3d292eb6c4c50269ce76b651ebd8a

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/a49c25d85869eba64d90b3b4c6a64eca4292a39e...d688b9a4ced3d292eb6c4c50269ce76b651ebd8a
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/20250319/317087e0/attachment.htm>


More information about the rb-commits mailing list