-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Proton initialized title files not found when casing does not match. #55
Comments
Ah, yeah, since Windows doesn't actually enforce the capitalization, it doesn't make sense to enforce it when checking a Windows entry on Linux. I'll see if I can make it case-insensitive here. In the meantime, don't forget that manual edits to the manifest will be reset when it downloads a new copy, so you may want to make a custom game entry instead until this is fixed (if it has the same name, it'll override the manifest's entry for that game). |
It turns out that the case sensitivity option in the glob crate is ignored outright (rust-lang/glob#61), so I would need to use a different crate to fix this. I tried globwalk, but it seems to have some other issues/differences that would prevent me from switching, and I'm not sure there are any other viable options right now. I'm afraid this may have to wait :/ |
Took another look at this. Here's what I found so far: Glob v0.3.0I double checked the behavior of the case sensitivity option, and it seems like it works in some cases, but not all. Example on Windows (setting: case-sensitive):
Similar behavior on Linux (setting: case-insensitive):
It seems like the case insensitivity option only affects text that's adjacent to a wildcard. GlobWalk v0.8.1Doesn't seem to support absolute paths in globs. Even if you provide an absolute path, I think it tries to find the path relative to the current folder. You can pass in a different base folder, but it doesn't seem to work correctly when the base is just With the below code, it took 28 seconds to scan a single game, and it encountered a large number of "permission denied" errors. Maybe related to Gilnaa/globwalk#29. diff --git a/src/path.rs b/src/path.rs
index 0cddfac..d0b7825 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -370,13 +370,15 @@ impl StrictPath {
}
pub fn glob(&self) -> Vec<StrictPath> {
- let options = glob::MatchOptions {
- case_sensitive: crate::prelude::CASE_INSENSITIVE_OS,
- require_literal_separator: true,
- require_literal_leading_dot: false,
- };
- match glob::glob_with(&self.render(), options) {
- Ok(xs) => xs.filter_map(|r| r.ok()).map(StrictPath::from).collect(),
+ let rendered = self.render();
+ let parts: Vec<_> = rendered.split('/').collect();
+ if parts.len() < 3 {
+ return vec![];
+ }
+ let base = format!("{}/{}", parts[0], parts[1]);
+ let path = parts[2..].join("/");
+ match globwalk::GlobWalkerBuilder::new(base, path).case_insensitive(crate::prelude::CASE_INSENSITIVE_OS).follow_links(true).build() {
+ Ok(xs) => xs.filter_map(|r| r.ok()).map(|x| StrictPath::from(x.path())).collect(),
Err(_) => vec![],
}
} Wax v0.5.0Significantly slower than the current implementation. Timing for a full backup preview:
It also doesn't natively support globs that begin with a Windows drive letter, which means every path has to be split in a way that it understands. diff --git a/src/path.rs b/src/path.rs
index 0cddfac..8254569 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -370,17 +370,16 @@ impl StrictPath {
}
pub fn glob(&self) -> Vec<StrictPath> {
- let options = glob::MatchOptions {
- case_sensitive: crate::prelude::CASE_INSENSITIVE_OS,
- require_literal_separator: true,
- require_literal_leading_dot: false,
+ let (drive, plain) = self.split_drive();
+ let plain = plain.replace('(', "\\(").replace(')', "\\)");
+ let glob = match wax::Glob::new(&plain) {
+ Ok(x) => x,
+ Err(_) => return vec![self.clone()],
};
- match glob::glob_with(&self.render(), options) {
- Ok(xs) => xs.filter_map(|r| r.ok()).map(StrictPath::from).collect(),
- Err(_) => vec![],
- }
+ glob.walk(drive + "/").filter_map(|r| r.ok()).map(|x| StrictPath::from(x.path())).collect()
}
+
pub fn same_content(&self, other: &StrictPath) -> bool {
self.try_same_content(other).unwrap_or(false)
} |
I've forked the Glob crate and just published Globetter, which fixes the case sensitivity option. I'm planning to incorporate this into Ludusavi. |
I had to modify the manifest make this entry pull in. The reason for the lower cases is due to the fact that the wine prefix was created on install, and the game's installer must have defaulted to create
my games/company of heroes 2
with that casing for no apparent reason.The PCGamingWiki could be updated, but would still be broken for users that already had a My Games folder for example.
before:
after:
The text was updated successfully, but these errors were encountered: