mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-01-26 16:54:32 +00:00
Merge pull request #2704 from Sonicadvance1/fexrootfsfetcher_arch
FEXRootFSFetcher: Support rolling release distros
This commit is contained in:
commit
9473025b18
@ -306,6 +306,7 @@ namespace DistroQuery {
|
||||
struct DistroInfo {
|
||||
std::string DistroName;
|
||||
std::string DistroVersion;
|
||||
bool RollingRelease;
|
||||
bool Unknown;
|
||||
};
|
||||
|
||||
@ -375,6 +376,9 @@ namespace DistroQuery {
|
||||
|
||||
if (FoundCount == 2) {
|
||||
Info.Unknown = false;
|
||||
if (Info.DistroName == "arch") {
|
||||
Info.RollingRelease = true;
|
||||
}
|
||||
return Info;
|
||||
}
|
||||
FoundCount = 0;
|
||||
@ -397,16 +401,25 @@ namespace DistroQuery {
|
||||
++FoundCount;
|
||||
}
|
||||
else if (Key == "VERSION_ID") {
|
||||
// Ubuntu provides VERSION_ID
|
||||
// Strip the two quotes from the VERSION_ID
|
||||
Value = Value.substr(1, Value.size() - 2);
|
||||
Info.DistroVersion = Value;
|
||||
++FoundCount;
|
||||
}
|
||||
else if (Key == "IMAGE_VERSION") {
|
||||
// Arch provides IMAGE_VERSION
|
||||
Info.DistroVersion = Value;
|
||||
++FoundCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (FoundCount == 2) {
|
||||
Info.Unknown = false;
|
||||
if (Info.DistroName == "arch") {
|
||||
Info.RollingRelease = true;
|
||||
}
|
||||
return Info;
|
||||
}
|
||||
FoundCount = 0;
|
||||
@ -705,7 +718,7 @@ namespace Zenity {
|
||||
const auto &Target = Targets[i];
|
||||
|
||||
bool ExactMatch = Target.DistroMatch == Info.DistroName &&
|
||||
Target.VersionMatch == Info.DistroVersion;
|
||||
(Info.RollingRelease || Target.VersionMatch == Info.DistroVersion);
|
||||
if (ExactMatch) {
|
||||
fextl::string Question = fextl::fmt::format("Found exact match for distro '{}'. Do you want to select this image?", Target.DistroName);
|
||||
if (ExecWithQuestion(Question)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user