mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-10-21 06:21:16 +00:00
Stop logging parse errors for vendor profiles removed by packaging (#16710)
Don't log a parse error for a vendor profile pruned beside its cache Packaging deletes <vendor>.json for every vendor that ships a .opc cache, but installable_cache_version still read it to compare versions. Every packaged build logged a JSON parse error per installed vendor at startup. Check that the file exists first, as installed_vendor_version already does. The returned version does not change.
This commit is contained in:
1 parent
0132d97d0f
commit
f31a931f2e
1 file changed
+3
-1
@@ -2024,7 +2024,9 @@ static Semver installable_cache_version(const boost::filesystem::path& dir, cons
|
||||
const auto cache_ver = Semver::parse(VendorCacheFile::peek_version((dir / (vendor + ".opc")).string(), vendor));
|
||||
if (! cache_ver)
|
||||
return Semver::invalid();
|
||||
const Semver profile_ver = get_version_from_json((dir / (vendor + ".json")).string());
|
||||
// Packaging prunes the profile of every vendor that ships a cache.
|
||||
const boost::filesystem::path json = dir / (vendor + ".json");
|
||||
const Semver profile_ver = boost::filesystem::exists(json) ? get_version_from_json(json.string()) : Semver();
|
||||
return cache_covers(*cache_ver, profile_ver) ? *cache_ver : Semver::invalid();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user