[Git][reproducible-builds/diffoscope][master] 2 commits: Remove "Dalvik dex file" from ApkFile FILE_TYPE_RE.

Chris Lamb (@lamby) gitlab at salsa.debian.org
Fri Feb 10 18:02:26 UTC 2023



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
c988c3ad by FC Stegerman at 2023-02-10T10:01:59-08:00
Remove "Dalvik dex file" from ApkFile FILE_TYPE_RE.

- - - - -
8d7762f6 by FC Stegerman at 2023-02-10T10:02:02-08:00
Improve DexFile FILE_TYPE_RE and add FILE_TYPE_HEADER_PREFIX.

- - - - -


2 changed files:

- diffoscope/comparators/apk.py
- diffoscope/comparators/dex.py


Changes:

=====================================
diffoscope/comparators/apk.py
=====================================
@@ -227,9 +227,7 @@ class Apksigner(Command):
 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|Dalvik dex file)\b"
-    )
+    FILE_TYPE_RE = re.compile(r"^(Android package|(Java|Zip) archive data)\b")
     FILE_EXTENSION_SUFFIX = {".apk"}
     CONTAINER_CLASSES = [ApkContainer, ZipContainer]
 


=====================================
diffoscope/comparators/dex.py
=====================================
@@ -60,7 +60,8 @@ class DexContainer(Archive):
 
 class DexFile(File):
     DESCRIPTION = "Dalvik .dex files"
-    FILE_TYPE_RE = re.compile(r"^Dalvik dex file .*\b")
+    FILE_TYPE_HEADER_PREFIX = b"dex\n"
+    FILE_TYPE_RE = re.compile(r"^Dalvik dex file\b")
     FILE_EXTENSION_SUFFIX = {".dex"}
     CONTAINER_CLASSES = [DexContainer]
 



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/1bb9b812238bda67d2705a262634a9d0ad3d9eb4...8d7762f639cdd06e9b95de9f050a9201ff26a844

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/compare/1bb9b812238bda67d2705a262634a9d0ad3d9eb4...8d7762f639cdd06e9b95de9f050a9201ff26a844
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/20230210/5e0bd280/attachment.htm>


More information about the rb-commits mailing list