casualsnek / waydroid_script

Python Script to add OpenGapps, Magisk, libhoudini translation library and libndk translation library to waydroid !
GNU General Public License v3.0
1.53k stars 147 forks source link

Attempt to Extract GApps failed (why tar and not unzip?) #77

Closed SUFandom closed 1 year ago

SUFandom commented 1 year ago

image

why is it using tar?

i mean its possible but why not unzip?

tar wasn't initially meant for uncompressing and compressing files, but to archiving several files in a single big file. Since people not only wanted to archive their files, but also, compress them, so they just pipe the tar output through any compressor that accepts data stream input and drops the results to a file. Profit!

Now, to make such task a painless as possible, tar decided to pipe internally the files generated to compression tools, like gzip, lzma, etc., which were activated by special flags for each format when running tar. That's why when you try to extract a corrupted file through tar you are shown the underlying tool error, instead of tar's:

$ tar zxf damaged.tar.gz gzip: damaged.tar.gz: unexpected end of file So, it isn't that tar doesn't uncompress zip files, just that tar doesn't have the ability to pipe it through the correct tool, since nobody actually bothered to implement it, and zip already accomplish the file archive function of the tar file format there's less reason for tar to support it.

Now, there are all-in-one tools that compress/uncompress everything you throw at them, again, you need to have the correct tools to actually support it. If you don't have them, the tool will fail.

~ Bralam from unix.stackexchange.com

https://unix.stackexchange.com/questions/146206/why-cant-tar-extract-zip-files#:~:text=tar%20wasn%27t%20initially,tool%20will%20fail.

Edit: someone made a point below the quotation why tar isnt fitting for zip