-
Notifications
You must be signed in to change notification settings - Fork 72
TAR: added zstd, lzma (xz) and bzip3 support #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
lejcik
wants to merge
31
commits into
OpenSalamander:main
Choose a base branch
from
lejcik:plugin-tar-added-zstd-and-lzma-support
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+945
−3,745
Open
Changes from 8 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
045f728
added lzma static library
lejcik be00ee5
added zstd static library
lejcik 8857ee1
added support for zstd and xz archives
lejcik 4053035
corrected wrong order of internal files in a .deb archive
lejcik e52ebce
updated plugin configuration registration
lejcik 859ce65
added porting info for the imported libs
lejcik cf64eef
tar plugin: updated to version 3.4.0
lejcik f99ecc2
one more forgotten note
lejcik 60d56e3
reformated with clang-format
lejcik 06e77fb
Merge branch 'main' into plugin-tar-added-zstd-and-lzma-support
lejcik 5a35541
Merge branch 'main' into plugin-tar-added-zstd-and-lzma-support
lejcik 114e951
used vcpkg to handle external dependencies
lejcik 5890216
reverted a few more leftovers
lejcik a2374fe
updated about-box
lejcik 5343120
reverted salamand.sln
lejcik c802c64
fixed a warning
lejcik f0725c7
code improvements from static analysis
lejcik 69410b3
reverted a typo
lejcik 023d3c2
tar project file update
lejcik b554a2c
got rid of unused function
lejcik 60c2bca
added support for extracting bzip3 archives
lejcik 17c0ae7
tar plugin: updated to version 3.5.0
lejcik bf09ef7
Merge branch 'main' into plugin-tar-added-zstd-and-lzma-support
lejcik 2f684e6
tar translations
lejcik 0074b15
Merge branch 'main' into plugin-tar-added-zstd-and-lzma-support
lejcik 02284d4
updated vcpkg release hash to version 2026.01.16
lejcik c335bc6
updated comments translations
lejcik 6b47e0a
updated about message
lejcik e95e34b
Merge branch 'main' into plugin-tar-added-zstd-and-lzma-support
lejcik 4cf3d2f
Merge branch 'main' into plugin-tar-added-zstd-and-lzma-support
lejcik 2f82c21
minor code improvement
lejcik File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -96,15 +96,16 @@ CDEBArchive::CDEBArchive(const char* fileName, CSalamanderForOperationsAbstract* | |
| pos += sizeof(ARBlock); | ||
|
|
||
| // Open the fist subarchive | ||
| controlArchive = new CArchive(fileName, salamander, pos, CQuadWord(SubArchiveSize, 0)); | ||
| if (!controlArchive->IsOk()) | ||
| CArchive *archive = new CArchive(fileName, salamander, pos, CQuadWord(SubArchiveSize, 0)); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the expected sub-archives can be in reverse order, |
||
| if (!archive->IsOk()) | ||
| { | ||
| delete controlArchive; | ||
| controlArchive = NULL; | ||
| delete archive; | ||
| archive = NULL; | ||
| return; | ||
| } | ||
| // We are happy if at least one subarchive was recognized | ||
| bOK = TRUE; | ||
| if (AssignArchive(ARBlock.FileName, archive)) | ||
| bOK = TRUE; | ||
|
|
||
| // Skip the subarchive and read the 3rd and last subarchive | ||
| if (SubArchiveSize & 1) | ||
|
|
@@ -127,12 +128,15 @@ CDEBArchive::CDEBArchive(const char* fileName, CSalamanderForOperationsAbstract* | |
| return; | ||
| } | ||
| sscanf(ARBlock.FileSize, "%u", &SubArchiveSize); | ||
| dataArchive = new CArchive(fileName, salamander, pos + sizeof(ARBlock), CQuadWord(0, 0)); | ||
| if (!dataArchive->IsOk()) | ||
| pos += sizeof(ARBlock); | ||
| archive = new CArchive(fileName, salamander, pos, CQuadWord(SubArchiveSize, 0)); | ||
| if (!archive->IsOk()) | ||
| { | ||
| delete dataArchive; | ||
| dataArchive = NULL; | ||
| delete archive; | ||
| archive = NULL; | ||
| } | ||
| if (AssignArchive(ARBlock.FileName, archive)) | ||
| bOK = TRUE; | ||
| CloseHandle(file); | ||
| } | ||
|
|
||
|
|
@@ -315,3 +319,21 @@ BOOL CDEBArchive::UnpackWholeArchive(const char* mask, const char* targetPath) | |
| } | ||
| return ret; | ||
| } | ||
|
|
||
| BOOL CDEBArchive::AssignArchive(const char* archName, CArchive* archive) | ||
| { | ||
| if (!controlArchive && !strncmp(archName, DEB_STREAM_NAME_CONTROL".", sizeof(DEB_STREAM_NAME_CONTROL".") - 1)) | ||
| { | ||
| controlArchive = archive; | ||
| return TRUE; | ||
| } | ||
| else if (!dataArchive && !strncmp(archName, DEB_STREAM_NAME_DATA".", sizeof(DEB_STREAM_NAME_DATA".") - 1)) | ||
| { | ||
| dataArchive = archive; | ||
| return TRUE; | ||
| } | ||
|
|
||
| // archiv se uz nebude pouzivat | ||
| delete archive; | ||
| return FALSE; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| a minimalistic lzma library port | ||
| ================================ | ||
|
|
||
| source: https://tukaani.org/xz/ | ||
| version: 5.4.4 | ||
| license: public domain | ||
|
|
||
| the port contains: | ||
| - library sources \src\common and \src\liblzma | ||
| - MSVC project file liblzma.vcxproj and config.h, taken from \windows\vz2019 and modified, | ||
| - license and readme files |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
|
|
||
| Authors of XZ Utils | ||
| =================== | ||
|
|
||
| XZ Utils is developed and maintained by Lasse Collin | ||
| <lasse.collin@tukaani.org> and Jia Tan <jiat0218@gmail.com>. | ||
|
|
||
| Major parts of liblzma are based on code written by Igor Pavlov, | ||
| specifically the LZMA SDK <https://7-zip.org/sdk.html>. Without | ||
| this code, XZ Utils wouldn't exist. | ||
|
|
||
| The SHA-256 implementation in liblzma is based on the code found from | ||
| 7-Zip <https://7-zip.org/>, which has a modified version of the SHA-256 | ||
| code found from Crypto++ <https://www.cryptopp.com/>. The SHA-256 code | ||
| in Crypto++ was written by Kevin Springle and Wei Dai. | ||
|
|
||
| Some scripts have been adapted from gzip. The original versions | ||
| were written by Jean-loup Gailly, Charles Levert, and Paul Eggert. | ||
| Andrew Dudman helped adapting the scripts and their man pages for | ||
| XZ Utils. | ||
|
|
||
| The initial version of the threaded .xz decompressor was written | ||
| by Sebastian Andrzej Siewior. | ||
|
|
||
| The initial version of the .lz (lzip) decoder was written | ||
| by Michał Górny. | ||
|
|
||
| CLMUL-accelerated CRC code was contributed by Ilya Kurdyukov. | ||
|
|
||
| Other authors: | ||
| - Jonathan Nieder | ||
| - Joachim Henke | ||
|
|
||
| The GNU Autotools-based build system contains files from many authors, | ||
| which I'm not trying to list here. | ||
|
|
||
| Several people have contributed fixes or reported bugs. Most of them | ||
| are mentioned in the file THANKS. | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
|
|
||
| XZ Utils Licensing | ||
| ================== | ||
|
|
||
| Different licenses apply to different files in this package. Here | ||
| is a rough summary of which licenses apply to which parts of this | ||
| package (but check the individual files to be sure!): | ||
|
|
||
| - liblzma is in the public domain. | ||
|
|
||
| - xz, xzdec, and lzmadec command line tools are in the public | ||
| domain unless GNU getopt_long had to be compiled and linked | ||
| in from the lib directory. The getopt_long code is under | ||
| GNU LGPLv2.1+. | ||
|
|
||
| - The scripts to grep, diff, and view compressed files have been | ||
| adapted from gzip. These scripts and their documentation are | ||
| under GNU GPLv2+. | ||
|
|
||
| - All the documentation in the doc directory and most of the | ||
| XZ Utils specific documentation files in other directories | ||
| are in the public domain. | ||
|
|
||
| - Translated messages are in the public domain. | ||
|
|
||
| - The build system contains public domain files, and files that | ||
| are under GNU GPLv2+ or GNU GPLv3+. None of these files end up | ||
| in the binaries being built. | ||
|
|
||
| - Test files and test code in the tests directory, and debugging | ||
| utilities in the debug directory are in the public domain. | ||
|
|
||
| - The extra directory may contain public domain files, and files | ||
| that are under various free software licenses. | ||
|
|
||
| You can do whatever you want with the files that have been put into | ||
| the public domain. If you find public domain legally problematic, | ||
| take the previous sentence as a license grant. If you still find | ||
| the lack of copyright legally problematic, you have too many | ||
| lawyers. | ||
|
|
||
| As usual, this software is provided "as is", without any warranty. | ||
|
|
||
| If you copy significant amounts of public domain code from XZ Utils | ||
| into your project, acknowledging this somewhere in your software is | ||
| polite (especially if it is proprietary, non-free software), but | ||
| naturally it is not legally required. Here is an example of a good | ||
| notice to put into "about box" or into documentation: | ||
|
|
||
| This software includes code from XZ Utils <https://tukaani.org/xz/>. | ||
|
|
||
| The following license texts are included in the following files: | ||
| - COPYING.LGPLv2.1: GNU Lesser General Public License version 2.1 | ||
| - COPYING.GPLv2: GNU General Public License version 2 | ||
| - COPYING.GPLv3: GNU General Public License version 3 | ||
|
|
||
| Note that the toolchain (compiler, linker etc.) may add some code | ||
| pieces that are copyrighted. Thus, it is possible that e.g. liblzma | ||
| binary wouldn't actually be in the public domain in its entirety | ||
| even though it contains no copyrighted code from the XZ Utils source | ||
| package. | ||
|
|
||
| If you have questions, don't hesitate to ask the author(s) for more | ||
| information. | ||
|
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there was some issue with computing available buffer size, but now I don't remember the details...