Skip to content

TAR: added zstd, lzma (xz) and bzip3 support#5

Open
lejcik wants to merge 29 commits into
OpenSalamander:mainfrom
lejcik:plugin-tar-added-zstd-and-lzma-support
Open

TAR: added zstd, lzma (xz) and bzip3 support#5
lejcik wants to merge 29 commits into
OpenSalamander:mainfrom
lejcik:plugin-tar-added-zstd-and-lzma-support

Conversation

@lejcik

@lejcik lejcik commented Dec 8, 2023

Copy link
Copy Markdown

Added support for opening .zstd and .xz files with TAR plugin.

Comment thread src/plugins/tar/bzip/bunzip.cpp Outdated
}
BZStream->next_in = (char *)DataStart;
BZStream->avail_in = (unsigned int)(DataEnd - DataStart);
BZStream->avail_in = GetUnreadInputBufferSize();

Copy link
Copy Markdown
Author

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...

Comment thread src/plugins/tar/deb/deb.cpp Outdated
// 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));

@lejcik lejcik Dec 8, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the expected sub-archives can be in reverse order, data first and control last, this is a fix for such case

Comment thread src/plugins/tar/tardll.cpp Outdated
@@ -158,7 +158,7 @@ CPluginInterfaceAbstract* WINAPI SalamanderPluginEntry(CSalamanderPluginEntryAbs
VERSINFO_VERSION_NO_PLATFORM,
VERSINFO_COPYRIGHT,
LoadStr(IDS_PLUGIN_DESCRIPTION),
"TAR" /* neprekladat! */, "tar;tgz;taz;tbz;gz;bz;bz2;z;rpm;cpio;deb");
"TAR" /* neprekladat! */, "tar;tgz;taz;tbz;gz;bz;bz2;xz;zst;z;rpm;cpio;deb;ipk");

@lejcik lejcik Dec 8, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.ipk file format should be equal to .deb ones, isn't it?

Comment thread src/plugins/tar/tardll.cpp Outdated
"%s " VERSINFO_VERSION "\n"
VERSINFO_COPYRIGHT "\n\n"
"bzip2 library Copyright © 1996-2010 Julian R Seward\n"
"Zstandard library Copyright © 2016-2023 Facebook, Inc.\n\n"

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copyright notice, as license of zstd requires

"*.rpm;*.cpio;*.deb",
ConfigVersion < 5); // pri upgradech se ignoruje, az na pripad, kdy se upgraduje na verzi 4 - nutny update kvuli "*.z" a dalsim
salamander->AddPanelArchiver("tgz;tbz;taz;tar;gz;bz;bz2;z;rpm;cpio;deb", FALSE, FALSE); // pri upgradech pluginu se ignoruje
salamander->AddCustomUnpacker("TAR-z (Plugin)", "*.z;*.tz;*taz;*.tar.z;*_tar.z;*_tar_z;*.tar_z", upgrade);

@lejcik lejcik Dec 8, 2023

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string with all file extensions was too long, I would rather split it

@manison

manison commented Dec 8, 2023

Copy link
Copy Markdown
Contributor

Wow, support for XZ compressed Debian packages has been high on my wish list. Thanks for this! 👍

@elieux

elieux commented Dec 9, 2023

Copy link
Copy Markdown

Is this the update from here? :) https://forum.altap.cz/viewtopic.php?p=71603

@lejcik

lejcik commented Dec 10, 2023

Copy link
Copy Markdown
Author

Is this the update from here? :) https://forum.altap.cz/viewtopic.php?p=71603

yes, it's exactly this one

@janrysavy

Copy link
Copy Markdown
Contributor

When compiling x64 targets, I receive the following warning:

salamander\src\plugins\tar\tardll.cpp(183,17): warning C4477: '_snprintf_s' : format string '%.*s' requires an argument of type 'int', but variadic argument 2 has type 'size_t'

@janrysavy

janrysavy commented Jan 2, 2024

Copy link
Copy Markdown
Contributor

Shouldn't we have one common vcpkg_installed directory for the whole Salamader project? It is now located in src\plugins\tar\vcpkg_installed, which would mean that the Salamander core and each plugin would have its own version?

Comment thread src/vcxproj/salamand.sln Outdated
@lejcik

lejcik commented Jan 2, 2024

Copy link
Copy Markdown
Author

When compiling x64 targets, I receive the following warning:

salamander\src\plugins\tar\tardll.cpp(183,17): warning C4477: '_snprintf_s' : format string '%.*s' requires an argument of type 'int', but variadic argument 2 has type 'size_t'

forgot to check also x64 compilation log, fixed,

@lejcik

lejcik commented Jan 2, 2024

Copy link
Copy Markdown
Author

Shouldn't we have one common vcpkg_installed directory for the whole Salamader project? It is now located in src\plugins\tar\vcpkg_installed, which would mean that the Salamander core and each plugin would have its own version?

this is a question if this is possible, the vcpkg.json manifest file defines dependencies per project, so each subproject in a solution should have its own manifest file, and may require different versions of the same libraries,

so far I didn't find anything useful in the documentation how to do that, but at least I'd add this to the .gitignore file to ignore the vcpkg_installed temporary stuff:

# vcpkg
vcpkg_installed/

@lejcik lejcik changed the title TAR: added zstd and lzma support TAR: added zstd, lzma (xz) and bzip3 support Sep 14, 2025
@lejcik

lejcik commented Sep 14, 2025

Copy link
Copy Markdown
Author

I added support also for bzip3 archives (.bz3 files), what is a successor of bzip2, see bzip3 project on github for more details,

here are plugin binaries for salamander 4:

enjoy 🙂

@melloware

Copy link
Copy Markdown

awesome work @lejcik !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants