-
-
Notifications
You must be signed in to change notification settings - Fork 241
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
Possible problem with the -spd switch and the option to exclude Mac resources? #1548
Comments
Thanks a lot for pointing to this @jajajaneeneenee. I've fixed this in this build: https://github.com/aonez/Keka/releases/download/dev-test-builds/Keka-v1.4.6.r5535.7z I'll be still using that option since it fixes other issues (#488 #1236) but I've added another flag ( PatchFrom 87dc425b78b15a04815f45bd87cf4e8a1e001844 Mon Sep 17 00:00:00 2001
From: aone <[email protected]>
Date: Wed, 20 Nov 2024 11:07:02 +0100
Subject: [PATCH] Always enable wildcard on exclusions
https://github.com/aonez/Keka/issues/1548
---
CPP/7zip/UI/Common/ArchiveCommandLine.cpp | 10 ++++++++++
CPP/7zip/UI/Common/ArchiveCommandLine.h | 2 ++
2 files changed, 12 insertions(+)
diff --git a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
index 45baca5..9d073aa 100755
--- a/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
+++ b/CPP/7zip/UI/Common/ArchiveCommandLine.cpp
@@ -181,6 +181,8 @@ enum Enum
#ifndef Z7_NO_CRYPTO
, kPassword
#endif
+
+ , kKeka
};
}
@@ -332,6 +334,8 @@ static const CSwitchForm kSwitchForms[] =
#ifndef Z7_NO_CRYPTO
, { "p", SWFRM_STRING }
#endif
+
+ , { "keka", SWFRM_SIMPLE }
};
static const char * const kUniversalWildcard = "*";
@@ -1314,6 +1318,8 @@ void CArcCmdLineParser::Parse2(CArcCmdLineOptions &options)
}
*/
+ options.KekaMode = parser[NKey::kKeka].ThereIs;
+
if (parser[NKey::kHashDir].ThereIs)
options.ExtractOptions.HashDir = parser[NKey::kHashDir].PostStrings[0];
@@ -1387,8 +1393,12 @@ void CArcCmdLineParser::Parse2(CArcCmdLineOptions &options)
if (parser[NKey::kExclude].ThereIs)
{
nop.Include = false;
+ bool bWildcardMatching = nop.WildcardMatching;
+ if (options.KekaMode)
+ nop.WildcardMatching = true;
AddSwitchWildcardsToCensor(options.Censor,
parser[NKey::kExclude].PostStrings, nop, codePage);
+ nop.WildcardMatching = bWildcardMatching; // Restore original setting
}
unsigned curCommandIndex = kCommandIndex + 1;
diff --git a/CPP/7zip/UI/Common/ArchiveCommandLine.h b/CPP/7zip/UI/Common/ArchiveCommandLine.h
index 439ee70..a5b7714 100755
--- a/CPP/7zip/UI/Common/ArchiveCommandLine.h
+++ b/CPP/7zip/UI/Common/ArchiveCommandLine.h
@@ -91,6 +91,8 @@ struct CArcCmdLineOptions
UString Password;
#endif
+ bool KekaMode;
+
UStringVector HashMethods;
// UString HashFilePath;
--
2.45.2
|
Many thanks for the quick response! I still have to try the dev test version 1.4.6... Thanks also for the information about other problem with the asterisk As far as I know, problematic or forbidden characters in Windows for file/foldernames are Is there a risk that characters other than I know that you should avoid special characters in file/folder names if possible, but if you are only used to macOS (in my case since OS6 ...), you don't necessarily see some of these characters as “special characters” that you should avoid in file/folder names. And I just checked if I have folders/files with I forgot to mention: when using Keka via the terminal, other switches that allow wildcards (e.g. -i, -ai, -ax) should also be possible with wildcards without causing problems with And if it is not possible (or not soon), perhaps it should be mentioned on the Terminal support wiki page. |
There's really not a problem with the asterisk per se, it's by default used as a wildcard. There should be no issues with any character as they are all converted to UTF8. That said this depends on the OS, app and filesystem you're using to code and decode, so it's always better to be safe and don't use special characters. As a norm, I always avoid most special characters in filenames, usually even spaces (replaced with
Again note this is not really a problem, but that |
Hello! OK, I understand ... I only asked for the question mark, because it can also be used as a wildcard (for a single character) – as far as I know – and if the asterisk in a file/foldername can cause problems as mentioned in #488/#1236, I wondered especially if something similar could happen with a question mark (I haven't tested it). One question: Should [And a little off-topic: I had problems with the context menu in the Finder after replacing v1.4.5 with the dev test version of v1.4.6 – the context menu commands were only processed after Keka was opened manually – is this “normal”, e.g. due to the dev test version? When I replaced it with v1.4.5, it worked again at once - although I had to deactivate and reactivate the context menu actions in the Keka settings once for them to even be displayed in the Finder. Or is that a case for a separate issue?] |
Regarding the context menu: I have to correct myself. It doesn't work properly with v1.4.5 either, even after uninstalling, reinstalling Keka and restarting the Mac (before I installed 1.4.6 dev test, it worked). I don't know how to fix it. Update: Could fix it with a reinstall of v1.4.5. v1.4.6 was still there, uncompressed in a subfolder. Maybe that was the reason... |
@jajajaneeneenee in the dev build only 7zz is modified, not 7z (older). The final build has this flag in both versions but you should always use 7zz over 7z (p7zip) if possible, if using macOS 10.13 or newer. As per the extension probably macOS sandbox magic is doing its thing. Just keep one version of Keka and restart your Mac if needed. |
Hello @aonez! Thanks for the hints ... They are very helpful! I apparently haven't figured out all the details of the binaries yet. I wasn't even aware that there is a 7z and a 7zz binary - my starting point for terminal exploration was https://github.com/aonez/Keka/wiki/Terminal-support, where these binaries are listed:
That's why I used 7z and assumed that this is the right one. But now I saw that the --help option of Keka has this output (and I never noticed the difference ...):
Maybe it would be useful to update the wiki info ... for stupid beginners ... There are also some outdated commands listed (I assume), such as (and here also with 7z an not 7zz):
(7z instead of 7zz and --client instead of --cli) And with the context menu extension, it's really not that easy to get it working again if it doesn't work properly - I've had to restart several times, delete Keka and the extension in ~/Library, new install etc. until it finally worked again... I hope that doesn't happen too often. |
Sadly the finder extension is totally controlled by macOS, Keka can’t do nothing about it other that have it inside. I’ll update the wiki, thanks for pointing that 🙌🏻 |
@jajajaneeneenee wiki updated and v1.4.6 released with |
Thank you for the quick fix! One last note (also on the subject of "special characters"): if I used Keka via the terminal, there were switches of 7zz such as You don't necessarily expect special characters to appear in switches for terminal commands. This is also a nasty stumbling block for Keka terminal beginners. Perhaps it would be worth mentioning on the terminal support wiki page? |
Configuration
Describe the bug
I've just started experimenting a bit with Keka's terminal support (it works well!), and I also switched on the verbose console output for compression as a test – when using the App (not via terminal). There I then saw which switches are set for the keka7zz binary when compressing something via the app (I tried with ZIP and had activated the "Exclude Mac resources" option in Keka).
I noticed the following:
The console output showed that these switches (among others) were set with wildcards to exclude Mac resources:
But in addition (according to the console output) the switch
-spd
is also set (which means: "disable wildcard matching for file names"). This also seems to apply to the -x switches ...Therefore, the above-mentioned -x switches will probably not work, and I also checked it with a test file. The result: a file such as "._test" is NOT excluded (while files like ".DS_Store" – without wildcards in the switch, here
-xr!.DS_Store
– were correctly excluded).To Reproduce
Expected behavior
The text was updated successfully, but these errors were encountered: