summaryrefslogtreecommitdiff
path: root/Userland/Utilities/unzip.cpp
AgeCommit message (Collapse)Author
2023-01-08LibArchive+Utilities: Stop using DeprecatedStringimplicitfield
This also slightly improves error propagation in tar, unzip and zip.
2022-12-23LibCore: Remove the `force` parameter from File::removeTim Schumacher
About half of the usages were not using `force` anyways, and the other half presumably just got confused about what "force" really means in this context (which is "ignore nonexistent files"). The only 'legitimate' user, which is `rm`, instead now handles this completely internally instead.
2022-12-20unzip: Use StringView instead of DeprecatedStringimplicitfield
2022-12-20unzip: Verify extracted files against CRC32 checksumsimplicitfield
This removes one TODO.
2022-12-12LibCompress: Port `DeflateDecompressor` to `Core::Stream`Tim Schumacher
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-06AK: Use an enum instead of a bool for String::replace(all_occurences)DexesTTP
This commit has no behavior changes. In particular, this does not fix any of the wrong uses of the previous default parameter (which used to be 'false', meaning "only replace the first occurence in the string"). It simply replaces the default uses by String::replace(..., ReplaceMode::FirstOnly), leaving them incorrect.
2022-07-02unzip: Remove the arbitrary file size limitTim Schumacher
Not being able to map the file chunk-by-chunk feels like a deficit of MappedFile and/or LibArchive, so it's weird that `unzip` is enforcing this size limit, and an especially arbitary one at that. Since "replace one error message with another error message" is the best possible outcome here, and making the user pass a useless flag in cases where it may not even be needed is the worst, let's just remove that file size limit. However, the `FIXME` about mapping files partially is left in because this is something that we definitely want to take a look at in the future.
2022-04-27unzip: Create parent directory before extracting filesTim Schumacher
2022-04-13Utilities/unzip: Use Core::Directory to create output directorySam Atkins
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-02-16Utilities: Add the 'files' argument to the unzip utilityserenitydev
2022-01-15unzip: Don't fail from mmap when trying to decompress empty filesRummskartoffel
Given an empty file, unzip would try to create a zero-size memory mapping of that file, which would fail with EINVAL. With this commit, attempting to unzip an empty file of course still fails, since that's not a valid PKZIP file, but it now fails for the correct reason and with the correct error message.
2022-01-04unzip: Remove useless .characters() callsmjz19910
2022-01-04unzip: Port to LibMainmjz19910
2021-11-23LibCore+AK: Move MappedFile from AK to LibCoreAndreas Kling
MappedFile is strictly a userspace thing, so it doesn't belong in AK (which is supposed to be user/kernel agnostic.)
2021-06-13Utilites: Implement `unzip -q`Jelle Raaijmakers
2021-06-13Utilities: Change `unzip -o` option to `-d`Jelle Raaijmakers
Other `unzip` implementations universally use `-d` to indicate the output directory, so let's follow this convention.
2021-05-17Utilities: Correct non-standard assert macros includesJean-Baptiste Boric
2021-05-12LibCore+Everywhere: Move OpenMode out of IODeviceAli Mohammad Pur
...and make it an enum class so people don't omit "OpenMode".
2021-04-25unzip: Add output directory optionTheGeopard
This allows setting the output directory for unzip by adding a new optional argument
2021-04-22Everything: Move to SPDX license identifiers in all files.Brian Gianforcaro
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
2021-03-23unzip: Use the new LibArchive Zip parserIdan Horowitz
This parser should be a little bit more modern and a little more resilient to zip files from other operating systems. As a side effect we now also support extracting zip files that are using DEFLATE compression (using our own LibCompress).
2021-02-23Everywhere: Rename ASSERT => VERIFYAndreas Kling
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED) Since all of these checks are done in release builds as well, let's rename them to VERIFY to prevent confusion, as everyone is used to assertions being compiled out in release. We can introduce a new ASSERT macro that is specifically for debug checks, but I'm doing this wholesale conversion first since we've accumulated thousands of these already, and it's not immediately obvious which ones are suitable for ASSERT.
2021-01-12Userland: Move command-line utilities to Userland/Utilities/Andreas Kling