diff mbox series

[v2,1/2] python3-libarchive-c: fix tests for libarchive 3.8.10

Message ID 20261020061031.82332-1-jaipaul.cheernam@est.tech
State New
Headers show
Series [v2,1/2] python3-libarchive-c: fix tests for libarchive 3.8.10 | expand

Commit Message

Jaipaul Cheernam Oct. 20, 2026, 6:10 a.m. UTC
Two entry tests broke with libarchive 3.8.10:

- testtar.tar is now rejected with "Unsupported pax global extended
  header attribute 'gname'" rather than "Damaged tar archive" [1], so
  accept either message.

- The ZIP reader now honours the NTFS (0x000A) extra field [2],
  reporting unicode2.zip's mtime in UTC with sub-second precision instead
  of the local-time MS-DOS field stored in the fixture, so ignore mtime
  in that comparison.

Testsuite summary without libarchive upgrade:
 TOTAL: 36
 PASS: 36
 SKIP: 0
 XFAIL: 0
 FAIL: 0
 XPASS: 0
 ERROR: 0

[1] https://github.com/libarchive/libarchive/commit/1769a39ecce23efff9684f36571a998533088df9
[2] https://github.com/libarchive/libarchive/commit/4f16dbc9edcb771a19119eaaf8634ee6b57287cb

Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 ...0001-fix-tests-for-libarchive-3.8.10.patch | 48 +++++++++++++++++++
 .../python/python3-libarchive-c_5.1.bb        |  1 +
 2 files changed, 49 insertions(+)
 create mode 100644 meta/recipes-devtools/python/python3-libarchive-c/0001-fix-tests-for-libarchive-3.8.10.patch
diff mbox series

Patch

diff --git a/meta/recipes-devtools/python/python3-libarchive-c/0001-fix-tests-for-libarchive-3.8.10.patch b/meta/recipes-devtools/python/python3-libarchive-c/0001-fix-tests-for-libarchive-3.8.10.patch
new file mode 100644
index 00000000000..66185a7493a
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-libarchive-c/0001-fix-tests-for-libarchive-3.8.10.patch
@@ -0,0 +1,48 @@ 
+From 10cf84fb4946d1b7b41401be00d22c80366df348 Mon Sep 17 00:00:00 2001
+From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+Date: Mon, 19 Oct 2026 19:27:01 +0000
+Subject: [PATCH] fix tests for libarchive 3.8.10
+
+Two entry tests broke with libarchive 3.8.10:
+
+- testtar.tar is now rejected with "Unsupported pax global extended
+  header attribute 'gname'" rather than "Damaged tar archive" [1], so
+  accept either message.
+
+- The ZIP reader now honours the NTFS (0x000A) extra field [2],
+  reporting unicode2.zip's mtime in UTC with sub-second precision instead
+  of the local-time MS-DOS field stored in the fixture, so ignore mtime
+  in that comparison.
+
+[1] https://github.com/libarchive/libarchive/commit/1769a39ecce23efff9684f36571a998533088df9
+[2] https://github.com/libarchive/libarchive/commit/4f16dbc9edcb771a19119eaaf8634ee6b57287cb
+
+Upstream-Status: Submitted [https://github.com/Changaco/python-libarchive-c/pull/145]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ tests/test_entry.py | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/tests/test_entry.py b/tests/test_entry.py
+index 7c8afa7..6eaba52 100644
+--- a/tests/test_entry.py
++++ b/tests/test_entry.py
+@@ -65,7 +65,8 @@ def test_check_archiveentry_using_python_testtar():
+     try:
+         check_entries(join(data_dir, 'testtar.tar'))
+     except ArchiveError as e:
+-        assert e.msg == "Damaged tar archive"
++        assert e.msg in ("Damaged tar archive",
++                         "Unsupported pax global extended header attribute 'gname'")
+ 
+ 
+ def test_check_archiveentry_with_unicode_and_binary_entries_tar():
+@@ -77,7 +78,7 @@ def test_check_archiveentry_with_unicode_and_binary_entries_zip():
+ 
+ 
+ def test_check_archiveentry_with_unicode_and_binary_entries_zip2():
+-    check_entries(join(data_dir, 'unicode2.zip'), ignore='mode')
++    check_entries(join(data_dir, 'unicode2.zip'), ignore='mode mtime')
+ 
+ 
+ def test_check_archiveentry_with_unicode_entries_and_name_zip():
diff --git a/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb b/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb
index 791326ba24a..ed2ea91e8c3 100644
--- a/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb
+++ b/meta/recipes-devtools/python/python3-libarchive-c_5.1.bb
@@ -7,6 +7,7 @@  LIC_FILES_CHKSUM = "file://LICENSE.md;md5=bcab380227a83bc147350b40a81e6ffc"
 
 SRC_URI += " \
         file://new-libarchive.patch \
+        file://0001-fix-tests-for-libarchive-3.8.10.patch \
         file://0001-ffi-Insert-a-replacable-anchor-for-find_library.patch \
         file://run-ptest \
 "