Skip to content

Commit

Permalink
New autoupdate channels for non-deprecated systems.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 17, 2023
1 parent 9c68fbe commit 0919789
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
23 changes: 18 additions & 5 deletions base/platform/linux/base_info_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,18 @@ constexpr auto kMaxDeviceModelLength = 15;
}
}

[[nodiscard]] bool IsGlibcLess228() {
static const auto result = [] {
const auto libcName = GetLibcName();
const auto libcVersion = GetLibcVersion();
return (libcName == qstr("glibc"))
&& !libcVersion.isEmpty()
&& (QVersionNumber::fromString(libcVersion)
< QVersionNumber(2, 28));
}();
return result;
}

} // namespace

QString DeviceModelPretty() {
Expand Down Expand Up @@ -185,16 +197,17 @@ QDate WhenSystemBecomesOutdated() {
const auto libcName = GetLibcName();
const auto libcVersion = GetLibcVersion();

if (libcName == qstr("glibc") && !libcVersion.isEmpty()) {
if (QVersionNumber::fromString(libcVersion) < QVersionNumber(2, 28)) {
return QDate(2023, 7, 1); // Older than CentOS 8.
}
if (IsGlibcLess228()) {
return QDate(2023, 7, 1); // Older than CentOS 8.
}
return QDate();
}

int AutoUpdateVersion() {
return 2;
if (IsGlibcLess228()) {
return 2;
}
return 4;
}

QString AutoUpdateKey() {
Expand Down
5 changes: 4 additions & 1 deletion base/platform/mac/base_info_mac.mm
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,10 @@ QDate WhenSystemBecomesOutdated() {
}

int AutoUpdateVersion() {
return 2;
if (!IsMac10_13OrGreater()) {
return 2;
}
return 4;
}

QString AutoUpdateKey() {
Expand Down
2 changes: 1 addition & 1 deletion base/platform/win/base_info_win.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ QDate WhenSystemBecomesOutdated() {
}

int AutoUpdateVersion() {
return 2;
return 4;
}

QString AutoUpdateKey() {
Expand Down

0 comments on commit 0919789

Please sign in to comment.