summaryrefslogtreecommitdiffstats
path: root/widget
diff options
context:
space:
mode:
Diffstat (limited to 'widget')
-rw-r--r--widget/LSBUtils.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/widget/LSBUtils.cpp b/widget/LSBUtils.cpp
index 520d50e5cc..672398cc86 100644
--- a/widget/LSBUtils.cpp
+++ b/widget/LSBUtils.cpp
@@ -45,6 +45,7 @@ bool GetOSRelease(nsACString& aDistributor, nsACString& aDescription,
bool seen_id = false, seen_pretty_name = false, seen_version_id = false;
std::string rawline;
nsAutoCString name;
+ nsAutoCString build_id;
while (std::getline(stream, rawline)) {
std::string_view line(rawline);
size_t pos = line.find('=');
@@ -68,6 +69,8 @@ bool GetOSRelease(nsACString& aDistributor, nsACString& aDescription,
if (ExtractAndSetValue(aDescription, value)) seen_pretty_name = true;
} else if (key == "VERSION_ID") {
if (ExtractAndSetValue(aRelease, value)) seen_version_id = true;
+ } else if (key == "BUILD_ID") {
+ ExtractAndSetValue(build_id, value);
} else if (key == "VERSION_CODENAME") {
ExtractAndSetValue(aCodename, value);
}
@@ -77,6 +80,11 @@ bool GetOSRelease(nsACString& aDistributor, nsACString& aDescription,
if (seen_id && !name.IsEmpty() && name.EqualsIgnoreCase(aDistributor)) {
aDistributor = name;
}
+ // If VERSION_ID is not set but BUILD_ID is, use BUILD_ID.
+ if (!seen_version_id && !build_id.IsEmpty()) {
+ aRelease = build_id;
+ seen_version_id = true;
+ }
// Only consider our work done if we've seen at least ID, PRETTY_NAME and
// VERSION_ID.
return seen_id && seen_pretty_name && seen_version_id;