SHA256
1
0
forked from pool/diffoscope

- remove fix-file-5.40.patch, merged upstream

- update to version 174:
  * Check that we are parsing an actual Debian .buildinfo file, not just
    a file with that extension.
    (Closes: deb#987994, reproducible-builds/diffoscope#254)
  * Support signed .buildinfo files again -- file(1) reports them as
    "PGP signed message".
  * Make the testsuite pass with file(1) version 5.40.
  * Embed some short test fixtures in the test code itself.
  * Fix recognition of compressed .xz files with file(1) 5.40.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/diffoscope?expand=0&rev=17
This commit is contained in:
Sebastian Wagner 2021-05-07 11:46:34 +00:00 committed by Git OBS Bridge
parent 74fe075f83
commit 340dbeb941
7 changed files with 35 additions and 142 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:d9865262de06b126e2a8f22e35cb826218ee41b97b00e0936320e554d9d64ae9
size 1314919

View File

@ -1,16 +0,0 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwv5L0nHBObhsUz5GHpU+J9QxHlgFAmCLtxAACgkQHpU+J9Qx
HljdBRAAnzXDCd3e9RpIWRQeEq4mUcdLFgWNdxgSCiRYuT8LCKjE9Uu/RwxYCnBs
IC/FXYTeHW7xZK5CixnJz/WD9UiqJvV4TnlpNIrY1xkm/H3HZ6bDSF317EYXmJ7U
NL7k/1PqJDbl7pP/pjNc+mUXlVVGK/U1VHgzWEEg32yx6hWGhgl1Nbe/kWOZKUG9
G5GIy5gwpB2CAMAM55foImKAngpLkYmeplX+YJlm/6P9Q9XEt0IKph0rhPMfDA1c
jsSZ/Gh0r5sKpn0l3M3eD0uFNa9bUosM0wLdSNqnKbzSHJDzpFHgd0C4Anuvl/6l
G/frMTPOO8Rtq9pgpWkWIYbKrNOcABqV0UKey8PV0DNoY2Iou5GvnvaPMNAtmDp4
NMrUnj8k92zGEPs9sRCKaIfPSGZjMBBp7PvlsWcYNd7i/rKnaxIv94ROs7NwaIia
LdvlN3ddTUI0FdJOuraeXQGpC5wgGyjYXrracNWSK0PGLZnfXhz9wfceHG3ajvdg
rsqf5mV6XBRptE7U5ju0ObNBVsGZAGU20FBtZGwJcQech9tXWVKn1dOSxA5T2JnT
QjTm6jmrrnH/yuAo/qNJErwokwx/4fXJnGtoZYppuITUqW9WiUAEJU7GdXxOX5tW
ZDM+uxLKq+8AzAhvhCujIkL4uT79DJT13t8n/tn723k5FTeTDy8=
=IkvH
-----END PGP SIGNATURE-----

3
diffoscope-174.tar.bz2 Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:708f58d5ebb3a194a82a15125a9a1f88fbe59a695d0fb97f3a98e7e38e7b33e8
size 1314322

View File

@ -0,0 +1,16 @@
-----BEGIN PGP SIGNATURE-----
iQIzBAABCAAdFiEEwv5L0nHBObhsUz5GHpU+J9QxHlgFAmCVDR0ACgkQHpU+J9Qx
HliyRhAAuwPDAZ500mWoC4cWEJl5xIzeEyHVyjGzKd7ZzkuyPR8IyBFgbJsPTZIb
krYHrxV5A9CtoOLucQDlJEvOog9VgBrmDSvUZuudOM1dAs6GTjG2+EHvyJ7732z2
Efnh7Jj4PMkaybb6f6pRMMw03/x0EQsYQNeeKz7FmFlV5CLO3INnK5hhfAsm78DI
rPMau6dqJYm/si+w7BskNXHnU8q6Zl+DHFQHObhkzJTXJll5U5yT56AETevY55hJ
QBu6HxIjP3zY5ELWVcVEJ3nlDMaBbEcEAOaDoDfvauz0TXjgGkURqzTrp1JbrsFc
JPiI4iEfg43NlZ6lvcgXoE6FoNhSDe8QVHZiXfFTU+sVQZkhxymAM8W51IOncIPd
4difIeSBPz6+uDhhtVfGHlKFZm8ImULzNLoyH8iZ8RmCSWuql4h70qetopyRE92O
Oz/nPv7tR1hfZlv+QUZynXOsL8cP+wb6XM8EJZSkBwtk6SEfiVmPpGrw3KSAGVP0
sr2gycvx70xs/uaWq0JOFzEefuBlZj+47eLVgSZ49HX4eG1xWczjoibB3FO9e8dC
SLVlGlcGbCaTDmkx5bMBkYoA8DWKUW5kqb+Jp5hrKEZGILsWDSGQcrMV9uGZpH9d
/OXIF8EBgvO/a3PTfaGHABeKukdVFqhtneTLzshWEqhxMUAFU8M=
=grHc
-----END PGP SIGNATURE-----

View File

@ -1,3 +1,17 @@
-------------------------------------------------------------------
Fri May 7 11:27:26 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- remove fix-file-5.40.patch, merged upstream
- update to version 174:
* Check that we are parsing an actual Debian .buildinfo file, not just
a file with that extension.
(Closes: deb#987994, reproducible-builds/diffoscope#254)
* Support signed .buildinfo files again -- file(1) reports them as
"PGP signed message".
* Make the testsuite pass with file(1) version 5.40.
* Embed some short test fixtures in the test code itself.
* Fix recognition of compressed .xz files with file(1) 5.40.
-------------------------------------------------------------------
Sun May 2 08:38:43 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>

View File

@ -17,7 +17,7 @@
Name: diffoscope
Version: 173
Version: 174
Release: 0
Summary: In-depth comparison of files, archives, and directories
License: GPL-3.0-or-later
@ -26,7 +26,6 @@ URL: https://diffoscope.org/
Source0: https://diffoscope.org/archive/diffoscope-%{version}.tar.bz2
Source1: https://diffoscope.org/archive/diffoscope-%{version}.tar.bz2.asc
Source2: diffoscope.keyring
Patch0: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/7bf04a62623d234a870fd62b0ee745c9b940f5d7.patch#/fix-file-5.40.patch
BuildRequires: fdupes
BuildRequires: python-rpm-macros
BuildRequires: python3-base >= 3.7
@ -113,7 +112,6 @@ debbindiff.
%prep
%setup -q
sed -i '0,/#!\/usr\/bin\/env/ d' diffoscope/main.py
%patch0 -p1
%build
%python3_build
@ -137,9 +135,7 @@ fi
%check
# test_identification https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/98
# test_content_source_without_extension temporarily disabled to get build working
# test_text_proper_indentation test_equal, test_different temporarily for: https://salsa.debian.org/reproducible-builds/diffoscope/-/issues/251
py.test-%{python3_bin_suffix} -k 'not test_identification and not test_content_source_without_extension and not test_text_proper_indentation and not test_equal and not test_different'
py.test-%{python3_bin_suffix} -k 'not test_identification'
%files
%doc README.rst

View File

@ -1,117 +0,0 @@
From 7bf04a62623d234a870fd62b0ee745c9b940f5d7 Mon Sep 17 00:00:00 2001
From: Mattia Rizzolo <mattia@debian.org>
Date: Fri, 30 Apr 2021 16:37:21 +0200
Subject: [PATCH] Make the testsuite pass with file v5.40
Closes: reproducible-builds/diffoscope#250
Signed-off-by: Mattia Rizzolo <mattia@debian.org>
---
tests/comparators/test_binary.py | 11 +++++++++--
tests/data/archive12.diff.txt | 4 ++--
tests/test_presenters.py | 2 +-
tests/test_quines.py | 8 +++++++-
tests/utils/tools.py | 8 ++++++++
5 files changed, 27 insertions(+), 6 deletions(-)
diff --git a/tests/comparators/test_binary.py b/tests/comparators/test_binary.py
index f5abc23d..77ccfe10 100644
--- a/tests/comparators/test_binary.py
+++ b/tests/comparators/test_binary.py
@@ -33,7 +33,11 @@ from diffoscope.comparators.missing_file import MissingFile
from diffoscope.comparators.utils.compare import Xxd
from ..utils.data import data, init_fixture, get_data, normalize_zeros
-from ..utils.tools import skip_unless_tools_exist, skip_unless_module_exists
+from ..utils.tools import (
+ skip_unless_tools_exist,
+ skip_unless_module_exists,
+ file_version_is_lt,
+)
TEST_FILE1_PATH = data("binary1")
@@ -56,7 +60,10 @@ def test_not_same_content(binary1, binary2):
def test_guess_file_type():
- assert File.guess_file_type(TEST_FILE1_PATH) == "data"
+ if file_version_is_lt("5.40"):
+ assert File.guess_file_type(TEST_FILE1_PATH) == "data"
+ else:
+ assert File.guess_file_type(TEST_FILE1_PATH) == "OpenPGP Public Key"
def test_guess_encoding_binary():
diff --git a/tests/data/archive12.diff.txt b/tests/data/archive12.diff.txt
index 27fd20ae..6276b2fb 100644
--- a/tests/data/archive12.diff.txt
+++ b/tests/data/archive12.diff.txt
@@ -11,5 +11,5 @@
│ │ +gzip compressed data, was "compressed", last modified: Sun Mar 19 22:27:42 2017, max compression, from Unix, truncated
│ ├── compressed
│ │ @@ -1 +1 @@
-│ │ -a
-│ │ +b
+│ │ -00000000: 610a a.
+│ │ +00000000: 620a b.
diff --git a/tests/test_presenters.py b/tests/test_presenters.py
index 98a01a8d..f785e156 100644
--- a/tests/test_presenters.py
+++ b/tests/test_presenters.py
@@ -85,7 +85,7 @@ def test_text_option_is_default(capsys):
assert out == get_data("output.txt")
-@skip_unless_file_version_is_at_least("5.39")
+@skip_unless_file_version_is_at_least("5.40")
def test_text_proper_indentation(capsys):
out = run(capsys, pair=("archive1.tar", "archive2.tar"))
diff --git a/tests/test_quines.py b/tests/test_quines.py
index 784bd4c2..0769b1d4 100644
--- a/tests/test_quines.py
+++ b/tests/test_quines.py
@@ -23,7 +23,10 @@ from diffoscope.comparators.zip import ZipFile
from diffoscope.comparators.gzip import GzipFile
from .utils.data import load_fixture, get_data
-from .utils.tools import skip_unless_file_version_is_at_least
+from .utils.tools import (
+ skip_unless_file_version_is_at_least,
+ file_version_is_ge,
+)
quine1 = load_fixture("quine.gz")
quine2 = load_fixture("quine.zip")
@@ -54,6 +57,9 @@ def differences(quine1, quine2):
@skip_unless_file_version_is_at_least("5.37")
def test_difference(differences):
expected_diff = get_data("quine_expected_diff")
+ if file_version_is_ge("5.40"):
+ expected_diff = expected_diff[:-1]
+ expected_diff += ", compression method=deflate\n"
assert differences[0].unified_diff == expected_diff
diff --git a/tests/utils/tools.py b/tests/utils/tools.py
index 3311ab5b..2f67405c 100644
--- a/tests/utils/tools.py
+++ b/tests/utils/tools.py
@@ -39,6 +39,14 @@ def file_version():
)
+def file_version_is_lt(version):
+ return file_version() < version
+
+
+def file_version_is_ge(version):
+ return file_version() >= version
+
+
def tools_missing(*required):
return not required or any(find_executable(x) is None for x in required)
--
GitLab