Merge pull request #252053 from amarshall/diffoscope-fix

This commit is contained in:
Ryan Lahfa 2023-09-02 01:16:02 +03:00 committed by GitHub
commit a3cbbe6e50
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 59 additions and 0 deletions

View File

@ -92,6 +92,7 @@ python3.pkgs.buildPythonApplication rec {
patches = [
./ignore_links.patch
./fix-test_fit.patch
];
postPatch = ''

View File

@ -0,0 +1,58 @@
From f1e9fa32c925fe7fb3cd825a02dcff52d305d845 Mon Sep 17 00:00:00 2001
From: Andrew Marshall <andrew@johnandrewmarshall.com>
Date: Mon, 28 Aug 2023 19:03:38 -0400
Subject: [PATCH] Fix test_fit with file 5.45
See also 435a8fe9a201a7e74e705e06cc56b66fa6cb4af9.
---
tests/comparators/test_fit.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/tests/comparators/test_fit.py b/tests/comparators/test_fit.py
index d8478c00..47258a3e 100644
--- a/tests/comparators/test_fit.py
+++ b/tests/comparators/test_fit.py
@@ -27,7 +27,11 @@
from diffoscope.comparators.utils.specialize import specialize
from ..utils.data import data, assert_diff, load_fixture
-from ..utils.tools import skip_unless_tools_exist, skip_unless_tool_is_at_least
+from ..utils.tools import (
+ skip_unless_file_version_is_at_least,
+ skip_unless_tool_is_at_least,
+ skip_unless_tools_exist,
+)
from ..utils.nonexisting import assert_non_existing
cpio1 = load_fixture("test1.cpio")
@@ -124,19 +128,21 @@ def test_nested_listing(nested_differences):
@skip_unless_tools_exist("cpio")
@skip_unless_tool_is_at_least("dumpimage", dumpimage_version, "2021.01")
@skip_unless_tools_exist("fdtdump")
+@skip_unless_file_version_is_at_least("5.45")
def test_nested_symlink(nested_differences):
- assert nested_differences[1].source1 == "dir/link"
- assert nested_differences[1].comment == "symlink"
- assert_diff(nested_differences[1], "symlink_expected_diff")
+ assert nested_differences[2].source1 == "dir/link"
+ assert nested_differences[2].comment == "symlink"
+ assert_diff(nested_differences[2], "symlink_expected_diff")
@skip_unless_tools_exist("cpio")
@skip_unless_tool_is_at_least("dumpimage", dumpimage_version, "2021.01")
@skip_unless_tools_exist("fdtdump")
+@skip_unless_file_version_is_at_least("5.45")
def test_nested_compressed_files(nested_differences):
- assert nested_differences[2].source1 == "dir/text"
- assert nested_differences[2].source2 == "dir/text"
- assert_diff(nested_differences[2], "text_ascii_expected_diff")
+ assert nested_differences[3].source1 == "dir/text"
+ assert nested_differences[3].source2 == "dir/text"
+ assert_diff(nested_differences[3], "text_ascii_expected_diff")
@skip_unless_tools_exist("cpio")
--
2.41.0