From 9175c1a1551419d326e5acfadf11b725ac5b2eb4d5effd12fc4d1416eed5c0b5 Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Tue, 12 Nov 2024 20:58:22 +0000 Subject: [PATCH] Accepting request 1223660 from home:mcalabkova:branches:devel:languages:python - Add upstream libarchive.patch to fix tests OBS-URL: https://build.opensuse.org/request/show/1223660 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libarchive-c?expand=0&rev=17 --- libarchive.patch | 38 +++++++++++++++++++++++++++++++++++++ python-libarchive-c.changes | 5 +++++ python-libarchive-c.spec | 6 ++++-- 3 files changed, 47 insertions(+), 2 deletions(-) create mode 100644 libarchive.patch diff --git a/libarchive.patch b/libarchive.patch new file mode 100644 index 0000000..014f0de --- /dev/null +++ b/libarchive.patch @@ -0,0 +1,38 @@ +From a56e9402c76c2fb9631651de7bae07b5fbb0b624 Mon Sep 17 00:00:00 2001 +From: "Charly C." +Date: Sun, 29 Sep 2024 13:43:13 +0200 +Subject: [PATCH] update a test failing with new libarchive versions (#131) + +fixes #130 +--- + tests/test_entry.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/tests/test_entry.py b/tests/test_entry.py +index 419cecb..34543a5 100644 +--- a/tests/test_entry.py ++++ b/tests/test_entry.py +@@ -9,7 +9,7 @@ + + import pytest + +-from libarchive import memory_reader, memory_writer ++from libarchive import ArchiveError, memory_reader, memory_writer + from libarchive.entry import ArchiveEntry, ConsumedArchiveEntry, PassedArchiveEntry + + from . import data_dir, get_entries, get_tarinfos +@@ -64,7 +64,13 @@ def test_check_ArchiveEntry_against_TarInfo(): + + + def test_check_archiveentry_using_python_testtar(): +- check_entries(join(data_dir, 'testtar.tar')) ++ # This test behaves differently depending on the libarchive version: ++ # 3.5, 3.6 and presumably all future versions reject the archive as damaged, ++ # whereas older versions accepted it. ++ try: ++ check_entries(join(data_dir, 'testtar.tar')) ++ except ArchiveError as e: ++ assert e.msg == "Damaged tar archive" + + + def test_check_archiveentry_with_unicode_and_binary_entries_tar(): diff --git a/python-libarchive-c.changes b/python-libarchive-c.changes index d270eeb..b54e6a6 100644 --- a/python-libarchive-c.changes +++ b/python-libarchive-c.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Nov 12 12:33:08 UTC 2024 - Markéta Machová + +- Add upstream libarchive.patch to fix tests + ------------------------------------------------------------------- Fri Mar 15 21:09:39 UTC 2024 - Dirk Müller diff --git a/python-libarchive-c.spec b/python-libarchive-c.spec index b2ebc4f..6f624af 100644 --- a/python-libarchive-c.spec +++ b/python-libarchive-c.spec @@ -18,7 +18,6 @@ %define requires_file() %( readlink -f '%*' | LC_ALL=C xargs -r rpm -q --qf 'Requires: %%{name} >= %%{epoch}:%%{version}\\n' -f | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not") -%{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-libarchive-c Version: 5.1 Release: 0 @@ -27,6 +26,8 @@ License: CC0-1.0 Group: Development/Languages/Python URL: https://github.com/Changaco/python-libarchive-c Source: https://files.pythonhosted.org/packages/source/l/libarchive-c/libarchive-c-%{version}.tar.gz +# PATCH-FIX-UPSTREAM https://github.com/Changaco/python-libarchive-c/pull/131 Handle new libarchive versions +Patch0: libarchive.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -63,6 +64,7 @@ export LANG="en_US.UTF-8" %files %{python_files} %doc README.rst %license LICENSE.md -%{python_sitelib}/* +%{python_sitelib}/libarchive +%{python_sitelib}/libarchive_c-%{version}*info %changelog