[Git][reproducible-builds/diffoscope][fix_squahsfs_4.5] comparators:squashfs: consider new retval for 4.5

Santiago Torres-Arias (@sangy-guest) gitlab at salsa.debian.org
Fri Aug 20 16:00:14 UTC 2021



Santiago Torres-Arias pushed to branch fix_squahsfs_4.5 at Reproducible Builds / diffoscope


Commits:
6c2e5a12 by Santiago Torres Arias at 2021-08-20T11:59:57-04:00
comparators:squashfs: consider new retval for 4.5

After version 4.5, squashfs distinguishes between fatal (retval==1) and
non-fatal (retval==2) errors. As such, we need to accomodate the
comparator to also consider this new retval. Update the behavior on the
comparator code to also take retval==2 into account.

See upstream commit for more information
https://github.com/plougher/squashfs-tools/commit/06fc061ef426672576075f2989f52acd873c0141

Signed-off-by: Santiago Torres Arias <santiago at archlinux.org>

- - - - -


1 changed file:

- diffoscope/comparators/squashfs.py


Changes:

=====================================
diffoscope/comparators/squashfs.py
=====================================
@@ -280,13 +280,16 @@ class SquashfsContainer(Archive):
         output, stderr = p.communicate()
 
         if p.returncode != 0:
-            # unsquashfs(1) exits with 1 (with a suitable logging messages that
-            # we can check for) if it could not extract, for example, character
-            # devices that require superuser privileges. In this case, don't
-            # treat this as a failure that requires reverting to xxd(1), but do
-            # let the user know via a comment.
+            # unsquashfs(1) exits with 1 (with a suitable logging messages
+            # that we can check for) if it could not extract, for example,
+            # character devices that require superuser privileges. In this
+            # case, don't treat this as a failure that requires reverting to
+            # xxd(1), but do let the user know via a comment. After 4.5, this
+            # return code can also be 2, to distinguish between fatal and
+            # non-fatal errors (see upstream commit
+            # 06fc061ef426672576075f2989f52acd873c0141)
             if (
-                p.returncode == 1
+                (p.returncode == 1 or p.returncode == 2)
                 and b"because you're not superuser" in stderr
                 and b"\n\ncreated " in output
             ):



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

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/6c2e5a12bac3d1f73a50a8d3b6594f83a4562db4
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/20210820/0c82fcc9/attachment.htm>


More information about the rb-commits mailing list