From 719ed1f63c17353c781b36ff929d35fd2868a858cb35767b6d1a6de30f8cb8f8 Mon Sep 17 00:00:00 2001 From: Nico Krapp Date: Tue, 22 Oct 2024 07:17:18 +0000 Subject: [PATCH] - Do not BuildRequire unar: this seems unused during the build/test phase. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-rarfile?expand=0&rev=23 --- .gitattributes | 23 ++++ .gitignore | 1 + python-rarfile.changes | 266 +++++++++++++++++++++++++++++++++++++++++ python-rarfile.spec | 80 +++++++++++++ rarfile-4.2.tar.gz | 3 + 5 files changed, 373 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 python-rarfile.changes create mode 100644 python-rarfile.spec create mode 100644 rarfile-4.2.tar.gz diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/python-rarfile.changes b/python-rarfile.changes new file mode 100644 index 0000000..41d0e18 --- /dev/null +++ b/python-rarfile.changes @@ -0,0 +1,266 @@ +------------------------------------------------------------------- +Tue Oct 22 06:44:49 UTC 2024 - Dominique Leuenberger + +- Do not BuildRequire unar: this seems unused during the build/test + phase. + +------------------------------------------------------------------- +Sat Jun 29 17:30:32 UTC 2024 - Luigi Baldoni + +- Update to version 4.2 + Features: + * Support unrar-free >= 0.2.0. + * Add RarFile.is_solid to check if archive uses solid compression. + Fixes: + * Support old multi-volume archives better where ENDARC does + not contain NEXTVOL. + version 4.1: + Features: + * Support 7zip/p7zip as decompression backend. + * RAR5: check password before trying to read file. + New APIs: + * Make get_rar_version a public function. + * New option: ``part_only`` for :class:`RarFile`, + to read only single file and allow it to be middle-part + of multi-volume archive. + * Add :meth:`RarFile.printdir`, use it in dumprar. Needed to + examine FILE_COPY or HARD_LINK entries that do not contain + data. + Fixes: + * Use OS separator to access filename. + * DirectReader: check seek position on each read. + Fixes read reading from multiple entries in parallel + on RarFile backed by file object. + * DirectReader: properly disable CRC check when seeking. + * Reset _hdrenc_main before processing a new volume. + Fixes CRC checks on multi-volume reads. + * Adapt to Python 3.10 argparse. + * SFX: Handle volume numbering special cases better. + * nsdatetime: support pypy internal use + * Throw error if backend does not support passwords. + Cleanups: + * Avoid isascii, not in 3.6 +- Drop help.patch (merged upstream) + +------------------------------------------------------------------- +Wed May 4 06:25:49 UTC 2022 - Markéta Machová + +- Add patch help.patch and enable Python 3.10 + * https://github.com/markokr/rarfile/pull/85 + +------------------------------------------------------------------- +Wed Feb 16 20:35:10 UTC 2022 - Dirk Müller + +- skip python 3.10 build - not yet supported + +------------------------------------------------------------------- +Fri Jul 31 22:20:37 UTC 2020 - Luigi Baldoni + +- Update to version 4.0 + Main goals are: + * Increased zipfile-compatibility, thus also achieving + smaller difference between RAR3 and RAR5 archives. + * Removing dependency on unrar for extract, thus making + maintenance of alternative backends more manageable. + Breaking changes: + * Directory names will have "/" appended. + * RarFile.extract operates only on single entry, so when used + on directory it will create directory but not extract files + under it. + * RarFile.extract / RarFile.extractall / RarFile.testrar will + not launch special unrar command line, instead they are + implemented on top of RarFile.open. + * Keyword args in top-level APIs were renamed to match zipfile: + + RarFile(rarfile) -> RarFile(file) + + RarFile.setpassword(password) -> .setpassword(pwd) + + RarFile.getinfo(fname) -> .getinfo(name) + + RarFile.open(fname, mode, psw) -> .open(name, mode, pwd) + + RarFile.read(fname, psw) -> .read(name, pwd) + * PATH_SEP cannot be changed from "/". + New features: + * RarFile.extract will return final sanitized filename + for target file. + * RarInfo.is_dir is now preferred spelling of isdir(). + Old method kept as alias. + * New RarInfo.is_file and RarInfo.is_symlink + methods. Only one of ~RarInfo.is_file, ~RarInfo.is_dir or + ~RarInfo.is_symlink can be True. + * RarFile.printdir has file argument for output. + * RarFile.__iter__ loops over RarInfo entries. + * RAR3: throw NeedFirstVolume exception with current volume + number, like RAR5 does. + * Nanosecond timestamp support. Visible as nsdatetime + instance. + * Minimal CLI when run as script: python3 -m rarfile + * Skip old file versions in versioned archive. + Cleanups: + * Use PBKDF2 implementation from hashlib. + * Improve test coverage. + version 3.3: + Fixes: + * Add the .sfx test files to MANIFEST.in for inclusion in pypi + tarball. + * Add all files in git to tarball. +- Run tests +- Switch to unar + +------------------------------------------------------------------- +Mon Jul 20 07:50:34 UTC 2020 - Luigi Baldoni + +- Update to version 3.2 + New features: + * Support unar as decompression backend. It has much + better support for RAR features than bsdtar. + * Support SFX archives - archive header is searched in first + 2MB of the file. + * Add :data:`HACK_TMP_DIR` option, to force temp files into + specific directory. + Fixes: + * Always use "/" for path separator in command-line + Cleanups: + * Drop module-level options from docs, they create confusion. + * Drop support for Python 2 and 3.5 and earlier. Python 2 is + dead and requiring Python 3.6 gives blake2s, stdlib that + supports pathlib, and ordered dict without compat hacks. + +------------------------------------------------------------------- +Mon Oct 14 14:40:03 UTC 2019 - Matej Cepl + +- Replace %fdupes -s with plain %fdupes; hardlinks are better. + +------------------------------------------------------------------- +Sat Sep 21 13:58:36 UTC 2019 - Luigi Baldoni + +- Update to version 3.1 (no changelog available) +- Spec cleanup + +------------------------------------------------------------------- +Wed Mar 29 17:01:35 UTC 2017 - aloisio@gmx.com + +- Converted to single-spec +- Improved description + +------------------------------------------------------------------- +Fri Feb 3 16:00:52 UTC 2017 - aloisio@gmx.com + +- Update to version 3.0 + New feature: + * Support RAR5 archive format. It is actually completely + different archive format from RAR3 one, only is uses same + file extension and tools are old one. + Except incompatibilies noted below, most of code should + notice no change, existing :class:`RarInfo` fields will + continue using RAR3-compatible values + (eg. :attr:`RarInfo.host_os`). RAR5-specific values + will use new fields. + Incompatibilities between rarfile v2.x and 3.x: + * Default :data:`PATH_SEP` is now '/' instead '\\'. + * Removed :data:`NEED_COMMENTS` option, comments are always + extracted. + * Removed :data:`UNICODE_COMMENTS` option, they are always + decoded. + * Removed :data:`USE_DATETIME` option, + :attr:`RarInfo.date_time` is always tuple, + :attr:`RarInfo.mtime`, :attr:`RarInfo.atime`, + :attr:`RarInfo.ctime` and + :attr:`RarInfo.arctime` are always + :class:`datetime.datetime` objects. + Fixes: + * Fixed bug when calling rarfp.open() on a RarInfo structure. + Cleanups: + * Code refactor to allow 2 different file format parsers. + * Code cleanups to pass modern linters. + * New testing and linting setup based on Tox_. + * Use setuptools instead distutils for install. + +- Changed source URL to pypi.io + +------------------------------------------------------------------- +Mon Sep 12 14:42:46 UTC 2016 - aloisio@gmx.com + +- Update to version 2.8 + * Fix: support solid archives from in-memory file object. + Full archive will be written out to temp file. [#21] + * Fix: ask unrar stop switches scanning, to handle archive + names starting with "-". (Alexander Shadchin) [#12] + * Fix: add missing _parse_error variable to RarFile object. + (Gregory Mazzola) [#20] + * Fix: return proper boolean from + :meth:`RarInfo.needs_password`. [#22] + * Fix: do not insert non-string rarfile into exception + string. (Tim Muller) [#23] + * Fix: make :meth:`RarFile.extract` and + :meth:`RarFile.testrar` support in-memory archives. + * Use cryptography module as preferred crypto backend. + PyCrypto will be used as fallback. + * Cleanup: remove compat code for Python 2.4/2.5/2.6. + +- Switched to bsdtar and made unrar dependency optional + +- Changed source URL + +------------------------------------------------------------------- +Mon Apr 25 15:00:53 UTC 2016 - aloisio@gmx.com + +- Update to version 2.7 + * Allow use of bsdtar as decompression backend. + It sits on top of libarchive, which has support for reading + RAR archives. + * Now rarfile checks if unrar and if not then tries bsdtar. If + that works, then keeps using it. If not then configuration + stays with unrar which will then appear in error messages. + * Both RarFile and is_rarfile() now accept file-like object. + Eg. io.BytesIO. Only requirement is that the object must be + seekable. This mirrors similar funtionality in zipfile. + * Uniform error handling. RarFile accepts errors="strict" argument. + * Allow user to tune whether parsing and missing file errors + will raise exception. If error is not raised, the error + string can be queried with RarFile.strerror() method. + +------------------------------------------------------------------- +Mon Jul 13 13:12:38 UTC 2015 - toddrme2178@gmail.com + +- Fix building on SLES 11 + +------------------------------------------------------------------- +Fri Aug 15 20:54:35 UTC 2014 - toddrme2178@gmail.com + +- Spec file cleanups + +------------------------------------------------------------------- +Thu Apr 11 07:53:51 UTC 2013 - lazy.kent@opensuse.org + +- Update to 2.6. + * Add context manager support for RarFile class. Both RarFile and + RarExtFile support with statement now. + * RarFile.volumelist() method, returns filenames of archive + volumes. + * Re-throw clearer error in case unrar is not found in PATH. + * Sync new unrar4.x error code from rar.txt. + * Use Sphinx for documentation. +- Build doc subpackage. + +------------------------------------------------------------------- +Sun Apr 29 22:17:52 UTC 2012 - lazy.kent@opensuse.org + +- Removed check for unsupported openSUSE versions. +- Corrected Description. + +------------------------------------------------------------------- +Thu Jan 19 18:20:45 UTC 2012 - lazy.kent@opensuse.org + +- Update to 2.5. + * Fixed bugs. + +------------------------------------------------------------------- +Fri Nov 11 07:10:33 UTC 2011 - lazy.kent@opensuse.org + +- Update to 2.4. + * Fix bug in corrupt unicode filename handling. +- Use full URL as a source. + +------------------------------------------------------------------- +Thu Nov 10 22:45:43 UTC 2011 - lazy.kent@opensuse.org + +- Initial package created - 2.3. + diff --git a/python-rarfile.spec b/python-rarfile.spec new file mode 100644 index 0000000..567f31c --- /dev/null +++ b/python-rarfile.spec @@ -0,0 +1,80 @@ +# +# spec file for package python-rarfile +# +# Copyright (c) 2024 SUSE LLC +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via https://bugs.opensuse.org/ +# + + +%define skip_python2 1 +Name: python-rarfile +Version: 4.2 +Release: 0 +Summary: RAR Archive Reader for Python +License: ISC +URL: https://rarfile.readthedocs.org/ +Source0: https://files.pythonhosted.org/packages/source/r/rarfile/rarfile-%{version}.tar.gz +BuildRequires: %{python_module pytest} +BuildRequires: %{python_module setuptools} +BuildRequires: 7zip +BuildRequires: bsdtar +BuildRequires: fdupes +BuildRequires: python-rpm-macros +BuildRequires: python3-Sphinx >= 1.3 +Requires: bsdtar +Recommends: unar +BuildArch: noarch +%python_subpackages + +%description +This is a Python module for RAR archive reading. It supports both RAR +2.x and 3.x archives, multi volume archives, Unicode filenames, +password-protected archives, archive and file comments. The archive +parsing and non-compressed files are handled in pure Python code, for +compressed files, the "unrar" utility is run. + +%package doc +Summary: RAR Archive Reader for Python (Documentation) +BuildArch: noarch + +%description doc +Python module for RAR archive reading. + +This package contains technical documentation. + +%prep +%autosetup -p1 -n rarfile-%{version} + +%build +%python_build +%make_build -C doc html +rm doc/_build/html/.buildinfo + +%install +%python_install +%python_expand %fdupes %{buildroot}%{$python_sitelib} + +%check +%pytest -k "not (test_unrar_tool or test_reading or test_rar3_header_encryption)" + +%files %{python_files} +%license LICENSE +%pycache_only %{python_sitelib}/__pycache__/rarfile.*.py* +%{python_sitelib}/rarfile.py* +%{python_sitelib}/rarfile-%{version}-py%{python_version}.egg-info + +%files %{python_files doc} +%license LICENSE +%doc doc/_build/html/ + +%changelog diff --git a/rarfile-4.2.tar.gz b/rarfile-4.2.tar.gz new file mode 100644 index 0000000..b42dbda --- /dev/null +++ b/rarfile-4.2.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8e1c8e72d0845ad2b32a47ab11a719bc2e41165ec101fd4d3fe9e92aa3f469ef +size 153476