From 990fe1410352e87cd706ae31bc2454e0502a1dec4af21ef2432fc94a99f2ec07 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 2 Dec 2024 08:46:39 +0000 Subject: [PATCH] - Update to 24.09: * The default dictionary size values for LZMA/LZMA2 compression methods were increased * 7-Zip now can calculate the following hash checksums: SHA-512, SHA-384, SHA3-256 and MD5. * APM and HFS support was improved. * If an archive update operation uses a temporary archive folder and the archive is moved to the destination folder, 7-Zip shows the progress of moving the archive file, as this operation can take a long time if the archive is large. * The bug was fixed: 7-Zip File Manager didn't propagate Zone.Identifier stream for extracted files from nested archives (if there is open archive inside another open archive). * Some bugs were fixed. OBS-URL: https://build.opensuse.org/package/show/Archiving/7zip?expand=0&rev=38 --- .gitattributes | 23 ++++ .gitignore | 1 + 7z2407-src.tar.xz | 3 + 7z2408-src.tar.xz | 3 + 7z2409-src.tar.xz | 3 + 7zip.changes | 228 ++++++++++++++++++++++++++++++++ 7zip.spec | 135 +++++++++++++++++++ 7zz.1 | 237 ++++++++++++++++++++++++++++++++++ fix-compatib-with-p7zip.patch | 41 ++++++ p7zip | 225 ++++++++++++++++++++++++++++++++ p7zip.1 | 79 ++++++++++++ 11 files changed, 978 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 7z2407-src.tar.xz create mode 100644 7z2408-src.tar.xz create mode 100644 7z2409-src.tar.xz create mode 100644 7zip.changes create mode 100644 7zip.spec create mode 100644 7zz.1 create mode 100644 fix-compatib-with-p7zip.patch create mode 100644 p7zip create mode 100644 p7zip.1 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/7z2407-src.tar.xz b/7z2407-src.tar.xz new file mode 100644 index 0000000..d91afcb --- /dev/null +++ b/7z2407-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d1b0874a3f1c26df21c761a4a30691dc1213e8577f18ee78326c14ca4d683e2b +size 1488556 diff --git a/7z2408-src.tar.xz b/7z2408-src.tar.xz new file mode 100644 index 0000000..88c0a0c --- /dev/null +++ b/7z2408-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aa04aac906a04df59e7301f4c69e9f48808e6c8ecae4eb697703a47bfb0ac042 +size 1493700 diff --git a/7z2409-src.tar.xz b/7z2409-src.tar.xz new file mode 100644 index 0000000..e6fea62 --- /dev/null +++ b/7z2409-src.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:49c05169f49572c1128453579af1632a952409ced028259381dac30726b6133a +size 1511288 diff --git a/7zip.changes b/7zip.changes new file mode 100644 index 0000000..4bcb507 --- /dev/null +++ b/7zip.changes @@ -0,0 +1,228 @@ +------------------------------------------------------------------- +Sun Dec 1 16:49:52 UTC 2024 - Antonio Teixeira + +- Update to 24.09: + * The default dictionary size values for LZMA/LZMA2 compression methods + were increased + * 7-Zip now can calculate the following hash checksums: SHA-512, SHA-384, SHA3-256 and MD5. + * APM and HFS support was improved. + * If an archive update operation uses a temporary archive folder and + the archive is moved to the destination folder, 7-Zip shows the progress of moving + the archive file, as this operation can take a long time if the archive is large. + * The bug was fixed: 7-Zip File Manager didn't propagate Zone.Identifier stream + for extracted files from nested archives (if there is open archive inside another open + archive). + * Some bugs were fixed. + +------------------------------------------------------------------- +Sun Aug 25 13:59:08 UTC 2024 - Andreas Stieger + +- update to 24.08: + * No longer write extra zero bytes after the end of the archive, + if a file included to archive cannot be compressed to a size + smaller than original + * Some optimizations for displaying file icons in 7-Zip File + Manager and in "Confirm File Replace" window. + * Some bugs were fixed + +------------------------------------------------------------------- +Thu Jun 20 15:44:47 UTC 2024 - Antonio Teixeira + +- Update to 24.07: + * The bug was fixed: 7-Zip could crash for some incorrect ZSTD archives. + +------------------------------------------------------------------- +Thu Jun 6 20:49:59 UTC 2024 - Antonio Teixeira + +- Update to 24.06: + * The bug was fixed: 7-Zip could not unpack some ZSTD archives. + +------------------------------------------------------------------- +Sun May 26 08:50:16 UTC 2024 - Andreas Stieger + +- update to 24.05: + * New switch -myv=.. to set decoder compatibility version for + 7z archive creating + * New switches -myfa and -myfd to allow or disallow the specified + filter method for 7z archive creating + * can use new RISCV filter for compression to 7z and xz archives + * can ask user permission to unpack RAR archives that require + large amount of memory + * new switch -smemx{size}g : to set allowed memory usage limit + for RAR archive unpacking. + * -y switch disables user requests and messages. + * -slmu switch : to show timestamps as UTC instead of LOCAL TIME + * support .sha256 files that use backslash path separator '\' + * can unpack ZSTD archives (.zst filename extension). + * can unpack ZIP, SquashFS and RPM archives that use ZSTD + compression method. + * support fast hash algorithm XXH64 that is used in ZSTD. + * can unpack RAR archives (that use larger than 4 GB dictionary) + created by new WinRAR 7.00. + * can unpack DMG archives that use XZ (ULMO/LZMA) compression method + * can unpack NTFS images with cluster size larger than 64 KB. + * can unpack MBR and GDP images with 4 KB sectors. + * Speed optimizations for archive unpacking: rar, cab, wim, zip, gz. + * Speed optimizations for hash caclulation: CRC-32, CRC-64, BLAKE2sp. + * Fix multivolume creation in some cases + * bug fixs +- drop fix-avx-sle.patch + +------------------------------------------------------------------- +Wed Mar 6 12:46:58 UTC 2024 - Dominique Leuenberger + +- Use autosetup -c instead of manually extracting the tarball and + applying patches: allows us to eliminate the usage of deprecated + %patchN. + +------------------------------------------------------------------- +Tue Jan 23 11:32:54 UTC 2024 - Danilo Spinella + +- Fix build on SLE-15-SP6 + * fix-avx-sle.patch + +------------------------------------------------------------------- +Tue Jan 2 20:37:25 UTC 2024 - Martin Schreiner + +- Add missing man pages for 7z / 7za / 7zr / 7zz. + This solves bsc#1204856. + +------------------------------------------------------------------- +Tue Jul 18 02:01:41 UTC 2023 - Linnaea Lavia + +- Enable ARM64 ASM introduced in 23.01 + +------------------------------------------------------------------- +Wed Jun 21 10:15:05 UTC 2023 - Fabian Vogt + +- Update to version 23.01: + * 7-Zip now can use new ARM64 filter for compression to 7z and xz archives. + ARM64 filter can increase compression ratio for data containing executable files + compiled for ARM64 (AArch64) architecture. + * Default section size for BCJ2 filter was changed from 64 MiB to 240 MiB. It + can increase compression ratio for executable files larger than 64 MiB. + * UDF: support was improved. + * cpio: support for hard links. + * Some changes and optimizations in WIM creation code. + * When new 7-Zip creates multivolume archive, 7-Zip keeps in open state only + volumes that still can be changed. Previous versions kept all volumes in open + state until the end of the archive creation. + * 7-Zip now can reduce the number of simultaneously open files, when + 7-Zip opens, extracts or creates multivolume archive. It allows to avoid the + failures for cases with big number of volumes, bacause there is a limitation for + number of open files allowed for a single program in Linux. + * The bugs were fixed: + * ZIP archives: if multithreaded zip compression was performed with + more than one file to stdout stream (-so switch), 7-zip didn't write "data + descriptor" for some files. + * ext4 archives: 7-Zip couldn't correctly extract symbolic link to directory from ext4 archives. + * HFS and APFS archives: 7-Zip incorrectly decoded uncompressed blocks (64 KiB) in compressed forks. + * Some another bugs were fixed. +- Refresh fix-compatib-with-p7zip.patch + +------------------------------------------------------------------- +Mon Dec 12 21:18:30 UTC 2022 - Dirk Müller + +- build for x86_64 subarchs the same way like for baseline + +------------------------------------------------------------------- +Wed Nov 30 10:47:14 UTC 2022 - Danilo Spinella + +- Enable ASM to increase performance in compression and decompression + bsc#1202197 + +------------------------------------------------------------------- +Fri Jul 22 21:16:09 UTC 2022 - Dirk Müller + +- update to 22.01: + * UDF support was improved to UDF version 2.60. + * HFS and APFS support was improved. + +------------------------------------------------------------------- +Sun Jul 3 21:01:22 UTC 2022 - Matthias Eliasson + +- Update to version 22.00: + * 7-Zip now can extract APFS (Apple File System) images that can be used in DMG files. + * 7-Zip now can create TAR archives in POSIX (pax) tar format with the switches + -ttar -mm=pax or -ttar -mm=posix + * 7-Zip now can store additional file timestamps with high precision (1 ns in Linux) + in tar/pax archives with the following switches: + -ttar -mm=pax -mtp=3 -mtc -mta + * New switches for Linux version for TAR archives: + -snoi : store owner/group ids in archive or set owner/group ids from archive to extracted files. + -snon : store owner/group names in archive + * New -snz switch to propagate Zone.Identifier stream to extracted files (Windows). + * New option "Propagate Zone.Id stream" in Tools/Options/7-Zip menu. + * New "Options" window in "Add to archive" allows to select what metadata must be + included to archive. Also it allows to select new option + "Do not change source files last access time". + * Some bugs were fixed. + +------------------------------------------------------------------- +Wed Jan 26 03:16:03 UTC 2022 - Dario Faggioli + +- Fix an incompatibility with p7zip which was breaking some downstreams + (e.g., GNOME's File-Roller). See bsc#1195041 + * Add fix-compatib-with-p7zip.patch + +------------------------------------------------------------------- +Wed Jan 12 16:45:41 UTC 2022 - Danilo Spinella + +- Replace p7zip with 7zip + * Add p7zip and p7zip.1 + +------------------------------------------------------------------- +Mon Jan 3 11:31:10 UTC 2022 - Danilo Spinella + +- Update to version 21.07: + * The sorting order of files in archives was slightly changed to be more + consistent for cases where the name of some directory is the same as the + prefix part of the name of another directory or file. + * TAR archives created by 7-Zip now are more consistent with archives + created by GNU TAR program. +- Remove unneeded pach remove-rar-handler.patch +- Use the tarball in place of the 7zip archive as Source + +------------------------------------------------------------------- +Wed Dec 22 20:48:46 UTC 2021 - Arjen de Korte + +- Extract source archive with bsdtar instead of p7zip +- Fixup line breaks of documentation files + +------------------------------------------------------------------- +Tue Dec 21 21:13:09 UTC 2021 - Arjen de Korte + +- update to version 21.06 + * Bug in LZMA encoder in file LzmaEnc.c was fixed: + - LzmaEnc_MemEncode(), LzmaEncode() and LzmaCompress() could work + incorrectly, if size value for output buffer is smaller than size + required for all compressed data. + - LzmaEnc_Encode() could work incorrectly, if callback + ISeqOutStream::Write() doesn't write all compressed data. + - NCompress::NLzma::CEncoder::Code() could work incorrectly, + if callback ISequentialOutStream::Write() returns error code. + * Bug in versions 21.00-21.05 was fixed: + 7-Zip didn't set attributes of directories during archive extracting. + +- update to version 21.04 + * 7-Zip now reduces the number of working CPU threads for compression, + if RAM size is not enough for compression with big LZMA2 dictionary. + * 7-Zip now can create and check "file.sha256" and "file.sha1" text + files that contain the list of file names and SHA-1 / SHA-256 + checksums in format compatible with sha1sum/sha256sum programs. + +- update to version 21.03 + * The maximum dictionary size for LZMA/LZMA2 compressing was increased + to 4 GB (3840 MiB). + * Minor speed optimizations in LZMA/LZMA2 compressing. + +------------------------------------------------------------------- +Tue Dec 21 00:07:36 UTC 2021 - Jan Engelhardt + +- Remove more -W flags for the Leap 15.x build to succeed + +------------------------------------------------------------------- +Tue Jul 6 14:36:25 UTC 2021 danilo.spinella@suse.com + +- Create initial version +- Add remove-rar-handler.patch diff --git a/7zip.spec b/7zip.spec new file mode 100644 index 0000000..eba9f58 --- /dev/null +++ b/7zip.spec @@ -0,0 +1,135 @@ +# +# spec file for package 7zip +# +# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2024 Andreas Stieger +# +# 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 stripped_version 2409 +Name: 7zip +Version: 24.09 +Release: 0 +Summary: Command-line file archiver with high compression ratio +# CPP/7zip/Compress/LzfseDecoder.cpp is under the BSD-3-Clause +# C/Sha1.c and C/Sha256.c are in the public domain +License: BSD-3-Clause AND LGPL-2.1-or-later AND SUSE-Public-Domain +Group: Productivity/Archiving/Compression +URL: https://www.7-zip.org/ +Source: https://www.7-zip.org/a/7z%{stripped_version}-src.tar.xz +Source1: p7zip +Source2: p7zip.1 +Source3: 7zz.1 +Patch0: fix-compatib-with-p7zip.patch +BuildRequires: dos2unix +BuildRequires: gcc +BuildRequires: gcc-c++ +Conflicts: p7zip +Conflicts: p7zip-full +Provides: p7zip = %{version} +Provides: p7zip-full = %{version} +Obsoletes: p7zip < %{version} +Obsoletes: p7zip-full < %{version} +%ifarch x86_64 %ix86 %x86_64 +BuildRequires: uasm +%endif + +%description +This package contains the 7z command line utility for archiving and +extracting various formats. + +%prep +%autosetup -p1 -c + +dos2unix DOC/*.txt +# Remove executable perms from docs +chmod -x DOC/*.txt + +# Remove -Werror to make build succeed +sed -i 's/-Werror//' CPP/7zip/7zip_gcc.mak +%if 0%{?suse_version} < 1550 +# (gcc 7.x) Remove -Waddress-of-packed-member to make build succeed +sed -i -e 's/-Waddress-of-packed-member//' -e 's/-Wcast-align=strict//' -e 's/-Wmissing-attributes//' C/warn_gcc.mak CPP/7zip/warn_gcc.mak +%endif +# Inject CFLAGS +sed -i 's/^ -fPIC/ -fPIC %{optflags}/' CPP/7zip/7zip_gcc.mak +sed -i 's/LFLAGS_ALL = -s/LFLAGS_ALL =/' CPP/7zip/7zip_gcc.mak +%ifarch x86_64 %ix86 %x86_64 +sed -i 's/$(CXX) -o $(PROGPATH)/$(CXX) -Wl,-z,noexecstack -o $(PROGPATH)/' CPP/7zip/7zip_gcc.mak +%endif + +%build +cd CPP/7zip/Bundles/Alone2 +%ifarch x86_64 %x86_64 +%make_build -f ../../cmpl_gcc_x64.mak MY_ASM=uasm +%else +%ifarch %ix86 +%make_build -f ../../cmpl_gcc_x86.mak MY_ASM=uasm +%else +%ifarch aarch64 +%make_build -f ../../cmpl_gcc_arm64.mak MY_ASM=gcc +%else +%make_build -f ../../cmpl_gcc.mak +%endif +%endif +%endif + +%install +%ifarch x86_64 %x86_64 +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g_x64/7zz %{buildroot}%{_bindir}/7zz +%else +%ifarch %ix86 +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g_x86/7zz %{buildroot}%{_bindir}/7zz +%else +%ifarch aarch64 +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g_arm64/7zz %{buildroot}%{_bindir}/7zz +%else +install -Dm 755 CPP/7zip/Bundles/Alone2/b/g/7zz %{buildroot}%{_bindir}/7zz +%endif +%endif +%endif + +# Create links for the executables provided by p7zip +ln -s %{_bindir}/7zz %{buildroot}%{_bindir}/7z +ln -s %{_bindir}/7z %{buildroot}%{_bindir}/7za +ln -s %{_bindir}/7z %{buildroot}%{_bindir}/7zr + +# Install p7zip wrapper and its manpage +install -m755 %{SOURCE1} %{buildroot}%{_bindir}/p7zip +install -m644 -Dt %{buildroot}%{_mandir}/man1 %{SOURCE2} +# Remove a mention of the p7zip-rar package that we don't have +sed -i 's/RAR (if the non-free p7zip-rar package is installed)//g' %{buildroot}%{_mandir}/man1/p7zip.1 + +# Install manpage for 7zz, and link 7z / 7za / 7zr accordingly +# This mimics the link structure used for the actual executables +install -m644 -Dt %{buildroot}%{_mandir}/man1 %{SOURCE3} +ln -s %{_mandir}/man1/7zz.1 %{buildroot}%{_mandir}/man1/7z.1 +ln -s %{_mandir}/man1/7z.1 %{buildroot}%{_mandir}/man1/7za.1 +ln -s %{_mandir}/man1/7z.1 %{buildroot}%{_mandir}/man1/7zr.1 + +%files +%license DOC/copying.txt DOC/License.txt +%doc DOC/readme.txt DOC/7zC.txt DOC/Methods.txt DOC/src-history.txt +%{_bindir}/7z +%{_bindir}/7za +%{_bindir}/7zr +%{_bindir}/7zz +%{_bindir}/p7zip +%{_mandir}/man1/p7zip.1%{?ext_man} +%{_mandir}/man1/7z.1%{?ext_man} +%{_mandir}/man1/7za.1%{?ext_man} +%{_mandir}/man1/7zr.1%{?ext_man} +%{_mandir}/man1/7zz.1%{?ext_man} + +%changelog diff --git a/7zz.1 b/7zz.1 new file mode 100644 index 0000000..49d556d --- /dev/null +++ b/7zz.1 @@ -0,0 +1,237 @@ +.\" +.TH 7z "1" "May 2023" "22.01" +.SH NAME +7z \- 7-Zip file archiver with a high compression ratio +.SH SYNOPSIS +.SY 7z +\fI\,command\/\fR +[\fI\,switches\/\fR\&.\|.\|.\&] +\fI\,archive_name\/\fR +[\fI\,file_names\/\fR] +[@\fI\,listfile\/\fR] +.YS +.SY 7zz +\fI\,command\/\fR +[\fI\,switches\/\fR\&.\|.\|.\&] +\fI\,archive_name\/\fR +[\fI\,file_names\/\fR] +[@\fI\,listfile\/\fR] +.YS +.SY 7za +\fI\,command\/\fR +[\fI\,switches\/\fR\&.\|.\|.\&] +\fI\,archive_name\/\fR +[\fI\,file_names\/\fR] +[@\fI\,listfile\/\fR] +.YS +.SY 7zr +\fI\,command\/\fR +[\fI\,switches\/\fR\&.\|.\|.\&] +\fI\,archive_name\/\fR +[\fI\,file_names\/\fR] +[@\fI\,listfile\/\fR] +.YS +.SH DESCRIPTION +7-Zip file archiver with a high compression ratio +.br +There are some variants for 7z executable. +.TP +7z +Full featured with plugin support +.TP +7zz +Full featured single binary executable with no plugins support +.TP +7za +Supports major formats only, no plugins, but smaller excutable size +.TP +7zr +Only supports LZMA codec and related formats (7z, lzma, xz), +no plugins, but smallest executable size +.SH OPTIONS +.SS Commands +.TP +a +Add files to archive +.TP +b +Benchmark +.TP +d +Delete files from archive +.TP +e +Extract files from archive (without using directory names) +.TP +h +Calculate hash values for files +.TP +i +Show information about supported formats +.TP +l +List contents of archive +.TP +rn +Rename files in archive +.TP +t +Test integrity of archive +.TP +u +Update files to archive +.TP +x +eXtract files with full paths +.SS Switches +.TP +\-\- +Stop switches and @\fI\,listfile\/\fR parsing +.TP +\-ai[r[\-|0]]{@\fI\,listfile\/\fR|!\fI\,wildcard\/\fR} +Include archives +.TP +\-ax[r[\-|0]]{@\fI\,listfile\/\fR|!\fI\,wildcard\/\fR} +eXclude archives +.TP +\-ao{a|s|t|u} +set Overwrite mode +.TP +\-an +disable archive_name field +.TP +\-bb[0\-3] +set output log level +.TP +\-bd +disable progress indicator +.TP +\-bs{o|e|p}{0|1|2} +set output stream for output/error/progress line +.TP +\-bt +show execution time statistics +.TP +\-i[r[\-|0]]{@\fI\,listfile\/\fR|!\fI\,wildcard\/\fR} +Include filenames +.TP +\-m{\fI\,Parameters\/\fR} +set compression Method +.RS +.TQ +\-mmt[\fI\,N\/\fR] +set number of CPU threads +.TQ +\-mx[\fI\,N\/\fR] +set compression level: \-mx1 (fastest) ... \-mx9 (ultra) +.RE +.TP +\-o{\fI\,Directory\/\fR} +set Output directory +.TP +\-p{\fI\,Password\/\fR} +set Password +.TP +\-r[\-|0] +Recurse subdirectories for name search +.TP +\-sa{a|e|s} +set Archive name mode +.TP +\-scc{UTF\-8|WIN|DOS} +set charset for for console input/output +.TP +\-scs{UTF\-8|UTF\-16LE|UTF\-16BE|WIN|DOS|{\fI\,id\/\fR}} +set charset for list files +.TP +\-scrc[CRC32|CRC64|SHA1|SHA256|*] +set hash function for \fBx\fR, \fBe\fR, \fBh\fR commands +.TP +\-sdel +delete files after compression +.TP +\-seml[.] +send archive by email +.TP +\-sfx[{\fI\,name\/\fR}] +Create SFX archive +.TP +\-si[{\fI\,name\/\fR}] +read data from stdin +.TP +\-slp +set Large Pages mode +.TP +\-slt +show technical information for \fBl\fR (List) command +.TP +\-snh +store hard links as links +.TP +\-snl +store symbolic links as links +.TP +\-sni +store NT security information +.TP +\-sns[\-] +store NTFS alternate streams +.TP +\-so +write data to stdout +.TP +\-spd +disable wildcard matching for file names +.TP +\-spe +eliminate duplication of root folder for extract command +.TP +\-spf +use fully qualified file paths +.TP +\-ssc[\-] +set sensitive case mode +.TP +\-sse +stop archive creating, if it can't open some input file +.TP +\-ssp +do not change Last Access Time of source files while archiving +.TP +\-ssw +compress shared files +.TP +\-stl +set archive timestamp from the most recently modified file +.TP +\-stm{\fI\,HexMask\/\fR} +set CPU thread affinity mask (hexadecimal number) +.TP +\-stx{\fI\,Type\/\fR} +exclude archive type +.TP +\-t{\fI\,Type\/\fR} +Set type of archive +.TP +\-u[\-][p\fI\,#\/\fR][q\fI\,#\/\fR][r\fI\,#\/\fR][x\fI\,#\/\fR][y\fI\,#\/\fR][z\fI\,#\/\fR][!\fI\,newArchiveName\/\fR] +Update options +.TP +\-v{\fI\,Size\/\fR}[b|k|m|g] +Create volumes +.TP +\-w[{\fI\,path\/\fR}] +assign Work directory. Empty path means a temporary directory +.TP +\-x[r[\-|0]]{@\fI\,listfile\/\fR|!\fI\,wildcard\/\fR} +eXclude filenames +.TP +\-y +assume Yes on all queries +.SH SEE ALSO +7-Zip +.UR https://\:www.7-zip.org/ +.UE +.SH COPYRIGHT +Copyright \(co 1999\-2023 Igor Pavlov. +.br +Distributed under the LGPL-2.1+ license. diff --git a/fix-compatib-with-p7zip.patch b/fix-compatib-with-p7zip.patch new file mode 100644 index 0000000..585bbf2 --- /dev/null +++ b/fix-compatib-with-p7zip.patch @@ -0,0 +1,41 @@ +From: Dario Faggioli +Date: Wed Jan 26 04:01:09 AM CET 2022 +Subject: [PATCH] Console: Avoid terminating on failed password check + +File-roller (i.e., GNOME's Archive Manager), which was working fine +with p7zip and p7zip-full, does not work well with 7zip. More specifically, +it is not possible to open or extract a password protected archive, for +which also the list of the files in the archive itself has been hidden. + +This seems to happen because now GetPassword_HRESULT() does some kind of +error checking, and depending on the results, cause its calling function +to return with an error, which in turns terminates the 7zz program in +a way that file-roller interpretes as a critical error, and everything +stops. + +On the other hand, in p7zip-full, the GetPassword() function wasn't +doing this. There's still a failure, but one that triggers File-roller +to ask the password of the archive, and once that is provided everything +works. + +From a CLI perspecvive, nothing changes, and things still work fine and +in the exact same way, no matter whether or not this patch is applied. + +Signed-off-by: Dario Faggioli +--- + OpenCallbackConsole.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +Index: 7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +=================================================================== +--- 7zip.orig/CPP/7zip/UI/Console/OpenCallbackConsole.cpp ++++ 7zip/CPP/7zip/UI/Console/OpenCallbackConsole.cpp +@@ -87,7 +87,7 @@ HRESULT COpenCallbackConsole::Open_Crypt + if (!PasswordIsDefined) + { + ClosePercents(); +- RINOK(GetPassword_HRESULT(_so, Password)) ++ GetPassword_HRESULT(_so, Password); + PasswordIsDefined = true; + } + return StringToBstr(Password, password); diff --git a/p7zip b/p7zip new file mode 100644 index 0000000..073bdbc --- /dev/null +++ b/p7zip @@ -0,0 +1,225 @@ +#!/bin/sh +# gzip-like CLI wrapper for p7zip +# version 3.0 +# +# History +# 2.0 : +# - support for -filename, "file name" +# - p7zip file1 file2 ... +# 3.0 : (robert@debian.org, March 2016) +# - use 7za or 7zr, whichever one is available +# - refactor the script for better readability +# - remove `"$?" != 0 ' checks that do not work with `set -e' +# - use stderr for error reporting +# - add support for -c, -f, -k options + +set -e + +# detect 7z program to use +prg7z="`which 7za 2>/dev/null`" || \ + prg7z="`which 7zr 2>/dev/null`" || \ + { echo "$0: cannot find neither 7za nor 7zr command" >&2; exit 1; } + +# global options +f_compress=true +f_keep=false +f_force=false +f_tostdout=false + +usage() +{ + echo "Usage: $0 [options] [--] [ name ... ]" + echo "" + echo "Options:" + echo " -c --stdout --to-stdout output data to stdout" + echo " -d --decompress --uncompress decompress file" + echo " -f --force do not ask questions" + echo " -k --keep keep original file" + echo " -h --help print this help" + echo " -- treat subsequent arguments as file" + echo " names, even if they start with a dash" + echo "" + exit 0 +} + +has_7z_suffix() +{ + case "$1" in + *.7z) + return 0 + ;; + *) + return 1 + ;; + esac; +} + +make_tmp_file() +{ + P7ZIPTMP="${TMP:-/tmp}" + mktemp "${P7ZIPTMP}/p7zip.XXXXXXXX" +} + +check_not_a_tty() +{ + if ! ${f_force} && ${f_compress} && tty <&1 >/dev/null ; then + echo "$0: compressed data not written to a terminal." >&2 + echo "For help, type: $0 -h" >&2 + exit 1 + fi +} + +compress_file() +{ + file="$1" + + if ! ${f_force} && has_7z_suffix "${file}"; then + echo "$0: $file already has the 7z suffix" >&2 + exit 1 + fi + + # compress to stdout via temporary file + if ${f_tostdout}; then + check_not_a_tty + tmp="`make_tmp_file`" + trap "rm -f -- ${tmp}" 0 + rm -f -- "${tmp}" + "${prg7z}" a -si -- "${tmp}" < "${file}" >/dev/null && cat "${tmp}" || \ + { echo "$0: failed to compress data to temporary file" >&2; exit 1; } + rm -f -- "${tmp}" + return 0 + fi + + # compress to a file + if ! ${f_force} && [ -e "${file}.7z" ]; then + echo "$0: destination file ${file}.7z already exists" >&2 + exit 1 + fi + + rm -f -- "${file}.7z" + flags="" + ${f_keep} || flags="$flags -sdel" + ! ${f_force} || flags="$flags -y" + "${prg7z}" a $flags -- "${file}.7z" "${file}" || { rm -f -- "${file}.7z"; exit 1; } +} + + +decompress_file() +{ + file="$1" + + has_7z_suffix "${file}" || { echo "$0: ${file}: unknown suffix" >&2; exit 1; } + + # decompress to stdout + if ${f_tostdout}; then + # The following `| cat' pipe shouldn't be needed, however it is here to + # trick 7z not to complain about writing data to terminal. + "${prg7z}" x -so -- "${file}" | cat || exit 1 + return 0; + fi + + flags="" + ! ${f_force} || flags="$flags -y" + "${prg7z}" x $flags -- "${file}" || exit 1 + + # remove original file unless the archive contains more than one file + if ! ${f_keep} && "${prg7z}" l -- "${file}" 2>/dev/null | grep -q '^1 file,' 2>/dev/null; then + rm -f -- "${file}" + fi +} + +process_file() +{ + file="$1" + + # check if file exists and is readable + [ -r "${file}" ] || { echo "$0: cannot read ${file}" >&2; exit 1; } + + if ${f_compress}; then + compress_file "${file}" + else + decompress_file "${file}" + fi +} + +process_stdin() +{ + check_not_a_tty + + tmp="`make_tmp_file`" + trap "rm -f -- ${tmp}" 0 + + if ${f_compress}; then + + rm -f -- "${tmp}" + "${prg7z}" a -si -- "${tmp}" >/dev/null && cat -- "${tmp}" || exit 1 + + else # decompress + + cat > "${tmp}" + # The following `| cat' pipe shouldn't be needed, however it is here to + # trick 7z not to complain about writing data to terminal. + "${prg7z}" x -so -- "${tmp}" | cat || exit 1 + fi + + rm -f -- "${tmp}" +} + + +## MAIN + + +# files and flags +while [ "$#" != "0" ] ; do + case "$1" in + -c|--stdout|--to-stdout) + f_tostdout=true + ;; + -d|--decompress|--uncompress) + f_compress=false # decompressing + ;; + -f|--force) + f_force=true + ;; + -h|--help) + usage + ;; + -k|--keep) + f_keep=true + ;; + --) + shift + break + ;; + -*) + echo "$0: ignoring unknown option $1" >&2 + ;; + *) + break + ;; + esac + shift +done + + +# make sure they're present, before we screw up +for i in mktemp rm cat tty grep; do + if ! which $i >/dev/null ; then + echo "$0: $i: command not found" >&2 + exit 1 + fi +done + +if [ "$#" = 0 ]; then + # compressing/decompressing using standard I/O + process_stdin + exit 0 +fi + +# only files now +while [ "$#" != "0" ] ; do + process_file "$1" + shift +done + +exit 0 diff --git a/p7zip.1 b/p7zip.1 new file mode 100644 index 0000000..fe25e4f --- /dev/null +++ b/p7zip.1 @@ -0,0 +1,79 @@ +.TH p7zip 1 "March 6th, 2016" "7-Zip" +.SH NAME +p7zip \- Wrapper on 7-Zip file archiver with high compression ratio +.SH SYNOPSIS +.B p7zip +.RB [ \-c | \-\-stdout | \-\-to\-stdout ] +.RB [ \-d | \-\-decompress | \-\-uncompress ] +.RB [ \-f | \-\-force ] +.RB [ \-h | \-\-help ] +.RB [ \-k | \-\-keep ] +.RB [ \-\- ] +.RI [ "file ..." ] +.SH DESCRIPTION +7-Zip is a file archiver supporting 7z (that implements LZMA compression algorithm +featuring very high compression ratio), LZMA2, XZ, ZIP, Zip64, CAB, +RAR (if the non-free p7zip-rar package is installed), ARJ, GZIP, BZIP2, TAR, CPIO, RPM, ISO, +most filesystem images and DEB formats. +Compression ratio in the new 7z format is 30-50% better than ratio in ZIP format. +.PP +.B p7zip +is a gzip-like CLI wrapper script for 7-Zip, and handles only the 7z format (the native +format of 7-Zip), internally executing either +.BR 7za (1) +or +.BR 7zr (1) +command. +.PP +With no switches passed in the command line, each given +.I file +argument is compressed into +.IR file.7z , +and then removed. +.PP +With the +.B \-d +switch each passed +.I file +needs to end with the +.I .7z +extension and is decompressed. After the +decompression the original +.I file +is removed unless it contained more than one archived file. +.PP +When used without any +.I file +argument, +.BR p7zip +reads data from the standard input and compresses (or decompresses in case of +.BR \-d ) +it into the standard output. +.SH SWITCHES +.TP +.BR \-c ", " \-\-stdout ", " \-\-to\-stdout +Write output on standard output. +.TP +.BR \-d ", " \-\-decompress ", " \-\-uncompress +Decompress file. +.TP +.BR \-f ", " \-\-force +Skip some checks and force compression or decompression. +.TP +.BR \-h ", " \--help +Print usage. +.TP +.BR \-k ", " \-\-keep +Do not delete input file. +.TP +.B \-\- +Treat all subsequent arguments as file names, even if they start with a dash. +.SH "SEE ALSO" +.BR 7z (1), +.BR 7za (1), +.BR 7zr (1), +.BR bzip2 (1), +.BR gzip (1), +.BR zip (1) +.SH AUTHOR +Written for Debian by Mohammed Adnene Trojette. Updated by Robert Luberda.