Default extract zip program from unzip to 7z
duarm opened this issue · comments
From my experience, 7z is faster and much more reliable than unzip, especially in non utf8 archives, consider using 7z instead of unzip or zip, I would also drop unrar in favor of 7z, but it could at least fallback to 7z when they are uninstalled.
Beside your experience, do you have any link to something backing that opinion?
Unfortunately no, usually benchmarks favor 7z over other programs, couldn't find one for unzip specifically, and on my own tests 7z is noticeably faster than unzip (~10%). Usually aunpack returns non-zero error code and I use 7z and it works. But even if they were equal, 7z supports multiple formats, so it makes sense to, if not by default, fallback to it if the program is not installed.
From their website:
Supported formats:
Packing / unpacking: 7z, XZ, BZIP2, GZIP, TAR, ZIP and WIM
Unpacking only: APFS, AR, ARJ, CAB, CHM, CPIO, CramFS, DMG, EXT, FAT, GPT, HFS, IHEX, ISO, LZH, LZMA, MBR, MSI, NSIS, NTFS, QCOW2, RAR, RPM, SquashFS, UDF, UEFI, VDI, VHD, VHDX, VMDK, XAR and Z.
For ZIP and GZIP formats, 7-Zip provides a compression ratio that is 2-10 % better than the ratio provided by PKZip and WinZip
So if the fallback is in place, I wouldn't need tar, zip, unzip, zstd, unrar, gzip and bzip from atool2 optdepends from the aur, just 7z covers all of these
I think the original idea of atool, was to wrap around every archive command for each format it can handle.
I understand the idea, and might look into it; but this might be beyond my perl skills (as said in the README.md)
If you want to do a PR, be my guest
I've decided to just rewrite atool in lua because I had nothing to do and I can actually understand what's happening in lua. It works the same, although still no diff feature and cat support is limited because I've never used both, so I'm supporting more formats passively. If you want to take a look https://gitlab.com/kurenaiz/satool
I was thinking to rewrite in python (did I mention that?), but I didn't find the motivation.
I don't know much lua, but at least, this is easier to read for a newbie.
My personnal taste would be to hide the verbose output of each subcommand called and only display a message like 'autodetected archive format tar.gz using 7z' something like that.
I didn't know about the acat prog. never used it ;-)
You are creating a directory and unarchive into it, no matter what. Even if that directory already exists.
May be I could open issue, on your repo?
If you implement most features, I could mention your tool, in the README.md here...
If you can, implement tests too
Good work!
I was thinking to rewrite in python (did I mention that?)
I don't think you did, not in this repo at least
My personnal taste would be to hide the verbose output of each subcommand called and only display a message like 'autodetected archive format tar.gz using 7z' something like that.
good idea, I was planning to implement a -q quiet flag to do that, I would much prefer to see what's happening by default, but it's kinda strange since every program shows a different output
You are creating a directory and unarchive into it, no matter what. Even if that directory already exists.
May be I could open issue, on your repo?
I'll fix that right away since I have some time, if you find anything, please
If you can, implement tests too
i shall, thanks
In fact, there already is a python rewrite of atool. Check https://github.com/wummel/patool
@duarm it seems to do what you asked: use 7z by default.
Oh well, if only we knew about it sooner
Jokes aside, mine is already done and I prefer it, since there's no external dependencies, lua instead of python, half the lines of code...
I also think they overengineered a little at a glance