summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/python/python3-libarchive-c
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-devtools/python/python3-libarchive-c')
-rw-r--r--meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch29
-rw-r--r--meta/recipes-devtools/python/python3-libarchive-c/new-libarchive.patch41
-rw-r--r--meta/recipes-devtools/python/python3-libarchive-c/run-ptest6
3 files changed, 76 insertions, 0 deletions
diff --git a/meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch b/meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch
new file mode 100644
index 0000000000..7b8775802f
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-libarchive-c/0001-ffi-Insert-a-replacable-anchor-for-find_library.patch
@@ -0,0 +1,29 @@
1From ed20aba335996d3aa97d99dfc122eb5a3a26ba1b Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 2 Nov 2024 11:06:01 -0700
4Subject: [PATCH] ffi: Insert a replacable anchor for find_library
5
6@@REPLACE_FIND_LIBRARY_API@@ must be sustituted from bitbake environment via
7recipe. This also helps in detecting changes to code from upstream in
8this area as this patch will fail to apply.
9
10Upstream-Status: Inappropriate [OE-Specific]
11
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 libarchive/ffi.py | 2 +-
15 1 file changed, 1 insertion(+), 1 deletion(-)
16
17diff --git a/libarchive/ffi.py b/libarchive/ffi.py
18index 1fc321a..991f1b6 100644
19--- a/libarchive/ffi.py
20+++ b/libarchive/ffi.py
21@@ -22,7 +22,7 @@ logger = logging.getLogger('libarchive')
22
23 page_size = mmap.PAGESIZE
24
25-libarchive_path = os.environ.get('LIBARCHIVE') or find_library('archive')
26+libarchive_path = os.environ.get('LIBARCHIVE') or @@REPLACE_FIND_LIBRARY_API@@
27 libarchive = ctypes.cdll.LoadLibrary(libarchive_path)
28
29
diff --git a/meta/recipes-devtools/python/python3-libarchive-c/new-libarchive.patch b/meta/recipes-devtools/python/python3-libarchive-c/new-libarchive.patch
new file mode 100644
index 0000000000..681e03a465
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-libarchive-c/new-libarchive.patch
@@ -0,0 +1,41 @@
1From adb206946721a4f5bd1190ab9c975bab4373e35c Mon Sep 17 00:00:00 2001
2From: Changaco <changaco@changaco.oy.lc>
3Date: Fri, 27 Sep 2024 11:51:22 +0200
4Subject: [PATCH] update a test failing with new libarchive versions
5
6fixes #130
7
8Upstream-Status: Submitted [https://github.com/Changaco/python-libarchive-c/pull/131]
9Signed-off-by: Ross Burton <ross.burton@arm.com>
10---
11 tests/test_entry.py | 10 ++++++++--
12 1 file changed, 8 insertions(+), 2 deletions(-)
13
14diff --git a/tests/test_entry.py b/tests/test_entry.py
15index 419cecb..34543a5 100644
16--- a/tests/test_entry.py
17+++ b/tests/test_entry.py
18@@ -9,7 +9,7 @@
19
20 import pytest
21
22-from libarchive import memory_reader, memory_writer
23+from libarchive import ArchiveError, memory_reader, memory_writer
24 from libarchive.entry import ArchiveEntry, ConsumedArchiveEntry, PassedArchiveEntry
25
26 from . import data_dir, get_entries, get_tarinfos
27@@ -64,7 +64,13 @@ def test_check_ArchiveEntry_against_TarInfo():
28
29
30 def test_check_archiveentry_using_python_testtar():
31- check_entries(join(data_dir, 'testtar.tar'))
32+ # This test behaves differently depending on the libarchive version:
33+ # 3.5, 3.6 and presumably all future versions reject the archive as damaged,
34+ # whereas older versions accepted it.
35+ try:
36+ check_entries(join(data_dir, 'testtar.tar'))
37+ except ArchiveError as e:
38+ assert e.msg == "Damaged tar archive"
39
40
41 def test_check_archiveentry_with_unicode_and_binary_entries_tar():
diff --git a/meta/recipes-devtools/python/python3-libarchive-c/run-ptest b/meta/recipes-devtools/python/python3-libarchive-c/run-ptest
new file mode 100644
index 0000000000..ddfbba7f94
--- /dev/null
+++ b/meta/recipes-devtools/python/python3-libarchive-c/run-ptest
@@ -0,0 +1,6 @@
1#!/bin/sh
2
3# export needed to set the locale to support accentuated and non-latin chars in tests
4export LC_ALL=en_US.UTF-8
5
6pytest --automake