Skip to content
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

TAR: added zstd and lzma support #5

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

lejcik
Copy link

@lejcik lejcik commented Dec 8, 2023

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

@@ -103,7 +103,7 @@ CBZip::DecompressBlock(unsigned short needed)
return FALSE;
}
BZStream->next_in = (char *)DataStart;
BZStream->avail_in = (unsigned int)(DataEnd - DataStart);
BZStream->avail_in = GetUnreadInputBufferSize();
Copy link
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...

@@ -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));
Copy link
Author

@lejcik lejcik Dec 8, 2023

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

@@ -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");
Copy link
Author

@lejcik lejcik Dec 8, 2023

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?

"%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
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);
Copy link
Author

@lejcik lejcik Dec 8, 2023

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
Copy link

manison commented Dec 8, 2023

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

@elieux
Copy link

elieux commented Dec 9, 2023

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

@lejcik
Copy link
Author

lejcik commented Dec 10, 2023

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

yes, it's exactly this one

@janrysavy
Copy link
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
Copy link
Contributor

janrysavy commented Jan 2, 2024

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?

src/vcxproj/salamand.sln Outdated Show resolved Hide resolved
@lejcik
Copy link
Author

lejcik commented Jan 2, 2024

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
Copy link
Author

lejcik commented Jan 2, 2024

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/

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.

4 participants