Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package diffoscope for openSUSE:Factory 
checked in at 2021-08-28 22:29:07
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/diffoscope (Old)
 and      /work/SRC/openSUSE:Factory/.diffoscope.new.1899 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "diffoscope"

Sat Aug 28 22:29:07 2021 rev:16 rq:914687 version:181

Changes:
--------
--- /work/SRC/openSUSE:Factory/diffoscope/diffoscope.changes    2021-08-18 
08:56:20.822944207 +0200
+++ /work/SRC/openSUSE:Factory/.diffoscope.new.1899/diffoscope.changes  
2021-08-28 22:29:22.241990430 +0200
@@ -1,0 +2,24 @@
+Fri Aug 20 19:49:53 UTC 2021 - Sebastian Wagner <sebix+novell....@sebix.at>
+
+- update to version 181:
+ - New features and bug fixes:
+   - Don't require apksigner in order to compare .apk files using apktool.
+   - Add a special-case to squshfs image extraction to not fail if we aren't
+     root/superuser. (Closes: #991059)
+   - Reduce the maximum line length to avoid O(n^2) Wagner-Fischer algorithm,
+     which meant that diff generation took an inordinate amount of time.
+     (Closes: reproducible-builds/diffoscope#272)
+   - Include profiling information in --debug output if --profile is not set.
+   - Don't print an orphan newline when the Black source code formatter
+     self-test passes.
+ - Tests:
+   - Update test to check specific contents of squashfs listing, otherwise it
+     fails depending on the test systems uid-to-username mapping in passwd(5).
+   - Assign "seen" and "expected" values to local variables to improve
+     contextual information in/around failed tests.
+ - Misc changes:
+   - Print the size of generated HTML, text (etc.) reports.
+   - Profile calls to specialize and diffoscope.diff.linediff.
+   - Update various copyright years.
+
+-------------------------------------------------------------------

Old:
----
  diffoscope-180.tar.bz2
  diffoscope-180.tar.bz2.asc

New:
----
  diffoscope-181.tar.bz2
  diffoscope-181.tar.bz2.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ diffoscope.spec ++++++
--- /var/tmp/diff_new_pack.dQTBX0/_old  2021-08-28 22:29:23.129991351 +0200
+++ /var/tmp/diff_new_pack.dQTBX0/_new  2021-08-28 22:29:23.133991355 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           diffoscope
-Version:        180
+Version:        181
 Release:        0
 Summary:        In-depth comparison of files, archives, and directories
 License:        GPL-3.0-or-later

++++++ diffoscope-180.tar.bz2 -> diffoscope-181.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/debian/changelog 
new/diffoscope-181/debian/changelog
--- old/diffoscope-180/debian/changelog 2021-08-06 14:57:33.000000000 +0200
+++ new/diffoscope-181/debian/changelog 2021-08-20 11:03:38.000000000 +0200
@@ -1,3 +1,31 @@
+diffoscope (181) unstable; urgency=medium
+
+  [ Chris Lamb ]
+
+  * New features and bug fixes:
+    - Don't require apksigner in order to compare .apk files using apktool.
+    - Add a special-case to squshfs image extraction to not fail if we aren't
+      root/superuser. (Closes: #991059)
+    - Reduce the maximum line length to avoid O(n^2) Wagner-Fischer algorithm,
+      which meant that diff generation took an inordinate amount of time.
+      (Closes: reproducible-builds/diffoscope#272)
+    - Include profiling information in --debug output if --profile is not set.
+    - Don't print an orphan newline when the Black source code formatter
+      self-test passes.
+
+  * Tests:
+    - Update test to check specific contents of squashfs listing, otherwise it
+      fails depending on the test systems uid-to-username mapping in passwd(5).
+    - Assign "seen" and "expected" values to local variables to improve
+      contextual information in/around failed tests.
+
+  * Misc changes:
+    - Print the size of generated HTML, text (etc.) reports.
+    - Profile calls to specialize and diffoscope.diff.linediff.
+    - Update various copyright years.
+
+ -- Chris Lamb <la...@debian.org>  Fri, 20 Aug 2021 10:03:35 +0100
+
 diffoscope (180) unstable; urgency=medium
 
   * Don't include specific ".debug"-like lines in the output, as it invariably
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/__init__.py 
new/diffoscope-181/diffoscope/__init__.py
--- old/diffoscope-180/diffoscope/__init__.py   2021-08-06 14:57:33.000000000 
+0200
+++ new/diffoscope-181/diffoscope/__init__.py   2021-08-20 11:03:38.000000000 
+0200
@@ -17,4 +17,4 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
-VERSION = "180"
+VERSION = "181"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/comparators/apk.py 
new/diffoscope-181/diffoscope/comparators/apk.py
--- old/diffoscope-180/diffoscope/comparators/apk.py    2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/diffoscope/comparators/apk.py    2021-08-20 
11:03:38.000000000 +0200
@@ -24,6 +24,7 @@
 import subprocess
 
 from diffoscope.difference import Difference
+from diffoscope.exc import RequiredToolNotFound
 from diffoscope.tools import tool_required, find_executable
 from diffoscope.tempfiles import get_temporary_directory
 
@@ -218,9 +219,13 @@
     def compare_details(self, other, source=None):
         differences = zipinfo_differences(self, other)
 
-        x = Difference.from_operation(Apksigner, self.path, other.path)
-        if x is not None:
-            differences.insert(0, x)
+        try:
+            x = Difference.from_operation(Apksigner, self.path, other.path)
+            if x is not None:
+                differences.insert(0, x)
+        except RequiredToolNotFound:  # noqa
+            # Don't require apksigner
+            pass
 
         return differences
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/comparators/elf.py 
new/diffoscope-181/diffoscope/comparators/elf.py
--- old/diffoscope-180/diffoscope/comparators/elf.py    2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/diffoscope/comparators/elf.py    2021-08-20 
11:03:38.000000000 +0200
@@ -2,7 +2,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright ?? 2014-2015 J??r??my Bobbio <lu...@debian.org>
-# Copyright ?? 2015-2020 Chris Lamb <la...@debian.org>
+# Copyright ?? 2015-2021 Chris Lamb <la...@debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/comparators/odt.py 
new/diffoscope-181/diffoscope/comparators/odt.py
--- old/diffoscope-180/diffoscope/comparators/odt.py    2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/diffoscope/comparators/odt.py    2021-08-20 
11:03:38.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # diffoscope: in-depth comparison of files, archives, and directories
 #
-# Copyright ?? 2017-2020 Chris Lamb <la...@debian.org>
+# Copyright ?? 2017-2021 Chris Lamb <la...@debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/comparators/squashfs.py 
new/diffoscope-181/diffoscope/comparators/squashfs.py
--- old/diffoscope-180/diffoscope/comparators/squashfs.py       2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/diffoscope/comparators/squashfs.py       2021-08-20 
11:03:38.000000000 +0200
@@ -35,7 +35,7 @@
 from .symlink import Symlink
 from .directory import Directory
 from .utils.archive import Archive, ArchiveMember
-from .utils.command import Command, our_check_output
+from .utils.command import Command
 
 logger = logging.getLogger(__name__)
 
@@ -260,20 +260,47 @@
 
         logger.debug("Extracting %s to %s", self.source.path, self._temp_dir)
 
-        output = our_check_output(
-            (
-                "unsquashfs",
-                "-n",
-                "-f",
-                "-no",
-                "-li",
-                "-d",
-                ".",
-                os.path.abspath(self.source.path),
-            ),
+        cmd = (
+            "unsquashfs",
+            "-n",
+            "-f",
+            "-no",
+            "-li",
+            "-d",
+            ".",
+            os.path.abspath(self.source.path),
+        )
+
+        p = subprocess.Popen(
+            cmd,
+            stdout=subprocess.PIPE,
             stderr=subprocess.PIPE,
             cwd=self._temp_dir,
         )
+        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.
+            if (
+                p.returncode == 1
+                and b"because you're not superuser" in stderr
+                and b"\n\ncreated " in output
+            ):
+                logger.debug("Ignoring unsquashfs return code")
+
+                self.source.add_comment(
+                    "Differences may be incomplete: {}".format(
+                        stderr.decode("utf-8")
+                    )
+                )
+            else:
+                raise subprocess.CalledProcessError(
+                    p.returncode, cmd, output, stderr
+                )
 
         output = iter(output.decode("utf-8").rstrip("\n").split("\n"))
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/diffoscope-180/diffoscope/comparators/utils/compare.py 
new/diffoscope-181/diffoscope/comparators/utils/compare.py
--- old/diffoscope-180/diffoscope/comparators/utils/compare.py  2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/diffoscope/comparators/utils/compare.py  2021-08-20 
11:03:38.000000000 +0200
@@ -93,8 +93,9 @@
 
     # Specialize the files first so "has_same_content_as" can be overridden
     # by subclasses
-    specialize(file1)
-    specialize(file2)
+    with profile("specialize", "specialize"):
+        specialize(file1)
+        specialize(file2)
 
     force_details = Config().force_details
     with profile("has_same_content_as", file1):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/diff.py 
new/diffoscope-181/diffoscope/diff.py
--- old/diffoscope-180/diffoscope/diff.py       2021-08-06 14:57:33.000000000 
+0200
+++ new/diffoscope-181/diffoscope/diff.py       2021-08-20 11:03:38.000000000 
+0200
@@ -32,6 +32,7 @@
 
 from .tools import get_tool_name, tool_required
 from .config import Config
+from .profiling import profile
 from .tempfiles import get_temporary_directory
 
 DIFF_CHUNK = 4096
@@ -386,7 +387,7 @@
 DIFFON = "\x01"
 DIFFOFF = "\x02"
 MAX_WAGNER_FISCHER_SIZE = (
-    1024  # any higher, and linediff takes >1 second and >200MB RAM
+    256  # any higher, and linediff takes >1 second and >200MB RAM
 )
 
 
@@ -450,6 +451,7 @@
     for j in range(1, n + 1):
         d[0][j] = (j, (0, j - 1))
 
+    # NB. This loop is O(len(s) * len(t))
     for i in range(1, m + 1):
         for j in range(1, n + 1):
             if s[i - 1] == t[j - 1]:
@@ -611,7 +613,8 @@
             type_name = "unmodified"
         else:
             type_name = "changed"
-            s1, s2 = linediff(s1, s2, self.diffon, self.diffoff)
+            with profile("diff", "linediff"):
+                s1, s2 = linediff(s1, s2, self.diffon, self.diffoff)
 
         yield "L", (type_name, s1, self.line1, s2, self.line2)
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/main.py 
new/diffoscope-181/diffoscope/main.py
--- old/diffoscope-180/diffoscope/main.py       2021-08-06 14:57:33.000000000 
+0200
+++ new/diffoscope-181/diffoscope/main.py       2021-08-20 11:03:38.000000000 
+0200
@@ -739,9 +739,8 @@
 
         log_handler = ProgressManager().setup(parsed_args)
 
-        with setup_logging(parsed_args.debug, log_handler) as logger:
+        with setup_logging(parsed_args.debug, log_handler) as _:
             post_parse(parsed_args)
-
             # Call main entry point
             sys.exit(run_diffoscope(parsed_args))
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/presenters/formats.py 
new/diffoscope-181/diffoscope/presenters/formats.py
--- old/diffoscope-180/diffoscope/presenters/formats.py 2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/diffoscope/presenters/formats.py 2021-08-20 
11:03:38.000000000 +0200
@@ -16,9 +16,11 @@
 # You should have received a copy of the GNU General Public License
 # along with diffoscope.  If not, see <https://www.gnu.org/licenses/>.
 
+import os
 import logging
 
 from ..profiling import profile
+from ..utils import format_bytes
 
 from .text import TextPresenter
 from .json import JSONPresenter
@@ -102,6 +104,17 @@
             with profile("output", name):
                 data["klass"].run(data, difference, parsed_args)
 
+            size = "n/a"
+            if os.path.isfile(data["target"]):
+                size = format_bytes(os.path.getsize(data["target"]))
+
+            logger.debug(
+                "Generated %r output at %r (size: %s)",
+                name,
+                data["target"],
+                size,
+            )
+
     def compute_visual_diffs(self):
         """
         Don't waste time computing visual differences if we won't use them.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/diffoscope/profiling.py 
new/diffoscope-181/diffoscope/profiling.py
--- old/diffoscope-180/diffoscope/profiling.py  2021-08-06 14:57:33.000000000 
+0200
+++ new/diffoscope-181/diffoscope/profiling.py  2021-08-20 11:03:38.000000000 
+0200
@@ -1,7 +1,7 @@
 #
 # diffoscope: in-depth comparison of files, archives, and directories
 #
-# Copyright ?? 2016-2017, 2019-2020 Chris Lamb <la...@debian.org>
+# Copyright ?? 2016-2017, 2019-2021 Chris Lamb <la...@debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,6 +22,7 @@
 import collections
 
 from .utils import format_class
+from .logging import setup_logging
 
 _ENABLED = False
 
@@ -50,7 +51,7 @@
 
     def setup(self, parsed_args):
         global _ENABLED
-        _ENABLED = parsed_args.profile_output is not None
+        _ENABLED = parsed_args.profile_output is not None or parsed_args.debug
 
     def increment(self, start, namespace, key):
         if not isinstance(key, str):
@@ -62,11 +63,13 @@
     def finish(self, parsed_args):
         from .presenters.utils import make_printer
 
+        # Include profiling in --debug output if --profile is not set.
         if parsed_args.profile_output is None:
-            return
-
-        with make_printer(parsed_args.profile_output) as fn:
-            self.output(fn)
+            with setup_logging(parsed_args.debug, None) as logger:
+                self.output(lambda x: logger.debug(x.strip("\n")))
+        else:
+            with make_printer(parsed_args.profile_output) as fn:
+                self.output(fn)
 
     def output(self, print_fn):
         title = "# Profiling output for: {}".format(" ".join(sys.argv))
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/tests/comparators/test_odt.py 
new/diffoscope-181/tests/comparators/test_odt.py
--- old/diffoscope-180/tests/comparators/test_odt.py    2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/tests/comparators/test_odt.py    2021-08-20 
11:03:38.000000000 +0200
@@ -1,7 +1,7 @@
 #
 # diffoscope: in-depth comparison of files, archives, and directories
 #
-# Copyright ?? 2017, 2020 Chris Lamb <la...@debian.org>
+# Copyright ?? 2017, 2020-2021 Chris Lamb <la...@debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/tests/comparators/test_squashfs.py 
new/diffoscope-181/tests/comparators/test_squashfs.py
--- old/diffoscope-180/tests/comparators/test_squashfs.py       2021-08-06 
14:57:33.000000000 +0200
+++ new/diffoscope-181/tests/comparators/test_squashfs.py       2021-08-20 
11:03:38.000000000 +0200
@@ -2,7 +2,7 @@
 # diffoscope: in-depth comparison of files, archives, and directories
 #
 # Copyright ?? 2015 J??r??my Bobbio <lu...@debian.org>
-# Copyright ?? 2015-2017, 2019-2020 Chris Lamb <la...@debian.org>
+# Copyright ?? 2015-2017, 2019-2021 Chris Lamb <la...@debian.org>
 #
 # diffoscope is free software: you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,7 @@
 
 from diffoscope.comparators.squashfs import SquashfsFile
 
-from ..utils.data import load_fixture, get_data
+from ..utils.data import load_fixture, assert_diff, get_data
 from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
 from ..utils.nonexisting import assert_non_existing
 
@@ -63,25 +63,41 @@
 
 @skip_unless_tool_is_at_least("unsquashfs", unsquashfs_version, "4.4")
 def test_superblock(differences):
-    expected_diff = get_data("squashfs_superblock_expected_diff")
-    assert differences[0].unified_diff == expected_diff
+    assert_diff(differences[0], "squashfs_superblock_expected_diff")
 
 
 @skip_unless_tools_exist("unsquashfs")
 def test_symlink(differences):
     assert differences[2].comment == "symlink"
-    expected_diff = get_data("symlink_expected_diff")
-    assert differences[2].unified_diff == expected_diff
+    assert_diff(differences[2], "symlink_expected_diff")
 
 
 @skip_unless_tools_exist("unsquashfs")
 def test_compressed_files(differences):
     assert differences[3].source1 == "/text"
     assert differences[3].source2 == "/text"
-    expected_diff = get_data("text_ascii_expected_diff")
-    assert differences[3].unified_diff == expected_diff
+    assert_diff(differences[3], "text_ascii_expected_diff")
 
 
 @skip_unless_tools_exist("unsquashfs")
 def test_compare_non_existing(monkeypatch, squashfs1):
     assert_non_existing(monkeypatch, squashfs1)
+
+
+# Test things that require root
+
+squashfs1_root = load_fixture("test1_root.squashfs")
+squashfs2_root = load_fixture("test2_root.squashfs")
+
+
+@pytest.fixture
+def differences_root(squashfs1_root, squashfs2_root):
+    return squashfs1_root.compare(squashfs2_root).details
+
+
+@skip_unless_tools_exist("unsquashfs")
+def test_symlink_root(differences_root):
+    assert (
+        get_data("squashfs_root_expected_diff")
+        in differences_root[1].unified_diff
+    )
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/diffoscope-180/tests/data/squashfs_root_expected_diff 
new/diffoscope-181/tests/data/squashfs_root_expected_diff
--- old/diffoscope-180/tests/data/squashfs_root_expected_diff   1970-01-01 
01:00:00.000000000 +0100
+++ new/diffoscope-181/tests/data/squashfs_root_expected_diff   2021-08-20 
11:03:38.000000000 +0200
@@ -0,0 +1 @@
+ crw-r--r-- root/root             1,  3 2015-06-24 14:47 /null
Binary files old/diffoscope-180/tests/data/test1_root.squashfs and 
new/diffoscope-181/tests/data/test1_root.squashfs differ
Binary files old/diffoscope-180/tests/data/test2_root.squashfs and 
new/diffoscope-181/tests/data/test2_root.squashfs differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/tests/test_source.py 
new/diffoscope-181/tests/test_source.py
--- old/diffoscope-180/tests/test_source.py     2021-08-06 14:57:33.000000000 
+0200
+++ new/diffoscope-181/tests/test_source.py     2021-08-20 11:03:38.000000000 
+0200
@@ -135,6 +135,7 @@
     "test1.rpm",
     "test1.sqlite3",
     "test1.squashfs",
+    "test1_root.squashfs",
     "test1.tar",
     "test1.xml",
     "test1.xsb",
@@ -195,6 +196,7 @@
     "test2.rpm",
     "test2.sqlite3",
     "test2.squashfs",
+    "test2_root.squashfs",
     "test2.tar",
     "test2.xml",
     "test2.xsb",
@@ -250,7 +252,8 @@
     ).decode("utf-8")
 
     # Display diff in "captured stdout call"
-    print(output)
+    if output:
+        print(output)
 
     assert not output, output
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/diffoscope-180/tests/utils/data.py 
new/diffoscope-181/tests/utils/data.py
--- old/diffoscope-180/tests/utils/data.py      2021-08-06 14:57:33.000000000 
+0200
+++ new/diffoscope-181/tests/utils/data.py      2021-08-20 11:03:38.000000000 
+0200
@@ -47,7 +47,11 @@
 
 
 def assert_diff(difference, filename):
-    assert difference.unified_diff == get_data(filename)
+    # Assign seen and expected values to local variables to improve contextual
+    # information in failed tests.
+    seen = difference.unified_diff
+    expected = get_data(filename)
+    assert seen == expected
 
 
 # 
https://code.activestate.com/recipes/576620-changedirectory-context-manager/#c3

Reply via email to