From b8fdb0d8ebb18542194e71c08c4b39e28bcc776f68d8dcf3483656b011d0cb2b Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Wed, 23 Mar 2022 21:25:41 +0000 Subject: [PATCH] Accepting request 964310 from home:pgajdos:python - version update to 4.0 4.0 --- BREAKING & SECURITY: The archive extraction functions now pass 3 security flags (SECURE_NODOTDOT, SECURE_NOABSOLUTEPATHS and SECURE_SYMLINKS) to libarchive by default, unless the current directory is the root. BREAKING: The ArchiveEntry properties atime, mtime, ctime, birthtime and size now have the value None instead of 0 when they're unset. BREAKING: The ArchiveEntry.pathname property now attempts to decode bytes using UTF-8. This breaks reading archives that contain file names which look like UTF-8 but aren't, if such a thing exists. Proper support of encodings will probably be added in the next version. Multiple entries from the same archive can now be kept in memory, however only the current entry's content can be read. The filetype, linkpath, size, mode, redvmajor, redvminor, uid and gid attributes of an archive entry can now be modified. The four time properties of archive entries now have setters, so for example entry.set_mtime(0, 0) can be replaced by entry.mtime = 0. Archive entries have 4 new properties: perm, rdev, uname and gname. When adding files to an archive, a destination path can now be specified. The ArchiveRead class now has a bytes_read property. The ArchiveWrite class now has a bytes_written property. Python 3.6 is no longer tested. The documentation has been improved. 3.2 --- This release fixes the seek callbacks passed to libarchive by the custom_reader and stream_reader function. See #116 for more details. 3.1 --- This release is mostly meant to fix #113 (a bug introduced in 3.0), but it also contains the following changes: the ffi.archive_error() function now returns an exception instead of raising it seekable_stream_reader is now an alias of stream_reader the misleadingly named ffi.VOID_CB function has been removed 3.0 --- Changes to the library: OBS-URL: https://build.opensuse.org/request/show/964310 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-libarchive-c?expand=0&rev=9 --- libarchive-c-2.9.tar.gz | 3 --- libarchive-c-4.0.tar.gz | 3 +++ python-libarchive-c-no-mock.patch | 23 +++++++++++++++++ python-libarchive-c.changes | 43 +++++++++++++++++++++++++++++++ python-libarchive-c.spec | 8 +++--- 5 files changed, 74 insertions(+), 6 deletions(-) delete mode 100644 libarchive-c-2.9.tar.gz create mode 100644 libarchive-c-4.0.tar.gz create mode 100644 python-libarchive-c-no-mock.patch diff --git a/libarchive-c-2.9.tar.gz b/libarchive-c-2.9.tar.gz deleted file mode 100644 index 786d3af..0000000 --- a/libarchive-c-2.9.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:9919344cec203f5db6596a29b5bc26b07ba9662925a05e24980b84709232ef60 -size 46408 diff --git a/libarchive-c-4.0.tar.gz b/libarchive-c-4.0.tar.gz new file mode 100644 index 0000000..6f201fd --- /dev/null +++ b/libarchive-c-4.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a5b41ade94ba58b198d778e68000f6b7de41da768de7140c984f71d7fa8416e5 +size 51171 diff --git a/python-libarchive-c-no-mock.patch b/python-libarchive-c-no-mock.patch new file mode 100644 index 0000000..3610d1f --- /dev/null +++ b/python-libarchive-c-no-mock.patch @@ -0,0 +1,23 @@ +diff --git a/tests/test_rwx.py b/tests/test_rwx.py +index 6b819ae..5daf201 100644 +--- a/tests/test_rwx.py ++++ b/tests/test_rwx.py +@@ -7,7 +7,7 @@ + from libarchive.entry import format_time + from libarchive.extract import EXTRACT_OWNER, EXTRACT_PERM, EXTRACT_TIME + from libarchive.write import memory_writer +-from mock import patch ++from unittest.mock import patch + import pytest + + from . import check_archive, in_dir, treestat +diff --git a/tox.ini b/tox.ini +index 9c0a989..ab68c84 100644 +--- a/tox.ini ++++ b/tox.ini +@@ -13,4 +13,3 @@ deps= + pytest-cov + pytest-xdist + six +- mock + diff --git a/python-libarchive-c.changes b/python-libarchive-c.changes index ac1e0f7..73cfec1 100644 --- a/python-libarchive-c.changes +++ b/python-libarchive-c.changes @@ -1,3 +1,46 @@ +------------------------------------------------------------------- +Wed Mar 23 13:50:58 UTC 2022 - pgajdos@suse.com + +- version update to 4.0 + 4.0 + --- + BREAKING & SECURITY: The archive extraction functions now pass 3 security flags (SECURE_NODOTDOT, SECURE_NOABSOLUTEPATHS + and SECURE_SYMLINKS) to libarchive by default, unless the current directory is the root. + BREAKING: The ArchiveEntry properties atime, mtime, ctime, birthtime and size now have the value None instead of 0 when they're unset. + BREAKING: The ArchiveEntry.pathname property now attempts to decode bytes using UTF-8. This breaks reading archives that + contain file names which look like UTF-8 but aren't, if such a thing exists. Proper support of encodings will probably be added + in the next version. + Multiple entries from the same archive can now be kept in memory, however only the current entry's content can be read. + The filetype, linkpath, size, mode, redvmajor, redvminor, uid and gid attributes of an archive entry can now be modified. + The four time properties of archive entries now have setters, so for example entry.set_mtime(0, 0) can be replaced by entry.mtime = 0. + Archive entries have 4 new properties: perm, rdev, uname and gname. + When adding files to an archive, a destination path can now be specified. + The ArchiveRead class now has a bytes_read property. + The ArchiveWrite class now has a bytes_written property. + Python 3.6 is no longer tested. + The documentation has been improved. + 3.2 + --- + This release fixes the seek callbacks passed to libarchive by the custom_reader and stream_reader function. See #116 for more details. + 3.1 + --- + This release is mostly meant to fix #113 (a bug introduced in 3.0), but it also contains the following changes: + the ffi.archive_error() function now returns an exception instead of raising it + seekable_stream_reader is now an alias of stream_reader + the misleadingly named ffi.VOID_CB function has been removed + 3.0 + --- + Changes to the library: + BREAKING: dropped support for Python 2.7 (#108) + implemented reading and writing encrypted archives (#109) + created a new context manager: seekable_stream_reader (#107) + added support for 64-bit time_t on 32-bit systems (#101) + load extra formats and filters when they're requested (#95) +- added patches + fix https://github.com/Changaco/python-libarchive-c/commit/13b904e2b046db25a42cd63557d259b3d3998323 + + python-libarchive-c-no-mock.patch +- do not require mock + ------------------------------------------------------------------- Wed Apr 15 12:28:28 UTC 2020 - pgajdos@suse.com diff --git a/python-libarchive-c.spec b/python-libarchive-c.spec index b90e9a0..351efcc 100644 --- a/python-libarchive-c.spec +++ b/python-libarchive-c.spec @@ -1,7 +1,7 @@ # # spec file for package python-libarchive-c # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,20 +18,21 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-libarchive-c -Version: 2.9 +Version: 4.0 Release: 0 Summary: Python interface to libarchive 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 +# https://github.com/Changaco/python-libarchive-c/commit/13b904e2b046db25a42cd63557d259b3d3998323 +Patch0: python-libarchive-c-no-mock.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: libarchive-devel BuildArch: noarch # SECTION test requirements -BuildRequires: %{python_module mock} BuildRequires: %{python_module pytest} BuildRequires: libarchive-devel # /SECTION @@ -43,6 +44,7 @@ dynamically load and access the C library. %prep %setup -q -n libarchive-c-%{version} +%patch0 -p1 %build %python_build