Skip to content

Commit 3d8f9fb

Browse files
authored
Merge pull request #231 from nextcloud/copilot/improve-legacy-platform-checks
Dynamic legacy platform channel routing with macOS < 13 support
2 parents d0055e5 + acabde6 commit 3d8f9fb

3 files changed

Lines changed: 136 additions & 40 deletions

File tree

config/config.php

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@
2323
$betaVersionSignature = 'RYWh27QN+GYl7If3pcpRVnny7ClHXpwjh7HqY06tXU0LXyfFqYciCFDdukdh49gfEVy9ocJjsJtSya/CxoG0DQ==';
2424
$betaVersionLength = 381334544;
2525

26+
//
27+
// stable Qt6.9 (macOS 11 / 12 — not compatible with Qt6.10)
28+
// fixed to the last Qt6.9-compatible stable release
29+
//
30+
$stableQt69ReleaseDate = '2026-01-22 18:00';
31+
$stableQt69Version = '4.0.6';
32+
$stableQt69VersionSignature = 'yzAm+RTOEtHCEmz1L4JHiRJkdfKMIeFAqYEJlaYNYP6s5IBKLq7YZY1sbtlmKQttRqKurB67s7dCuaGA2A6VBA==';
33+
$stableQt69VersionLength = 345060719;
34+
$stableQt69VersionFileProviderSignature = 'BCONOVs9x/wJxP4y5i0gqdwEErYFy9HFfGHYyWuXxUn6mgzhMlFLt3lFQOsuVvz2ADsR+fEdIqSFiSN8zEDYAA==';
35+
$stableQt69VersionFileProviderLength = 373240934;
36+
2637
//
2738
// stable
2839
//
@@ -81,6 +92,9 @@
8192
$stableVersionString = 'Nextcloud Client ' . $stableVersion;
8293
$stableUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $stableVersion . '/';
8394

95+
$stableQt69VersionString = 'Nextcloud Client ' . $stableQt69Version;
96+
$stableQt69Url = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $stableQt69Version . '/';
97+
8498
$enterpriseVersionString = 'Nextcloud Client ' . $enterpriseVersion;
8599
$enterpriseUrl = 'https://github.com/nextcloud-releases/desktop/releases/download/v' . $enterpriseVersion . '/';
86100

@@ -128,6 +142,23 @@
128142
"fileProviderLength" => 97371547,
129143
],
130144
],
145+
'stable-qt6.9' => [
146+
'release' => $stableQt69ReleaseDate,
147+
'macos' => [
148+
'version' => $stableQt69Version,
149+
'versionstring' => $stableQt69VersionString,
150+
"fileProviderVersionString" => $stableQt69VersionString,
151+
'downloadurl' => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '.pkg',
152+
'fileProviderDownloadUrl' => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '-macOS-vfs.pkg',
153+
'web' => 'https://nextcloud.com/install',
154+
"sparkleDownloadUrl" => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '.pkg.tbz',
155+
"fileProviderSparkleDownloadUrl" => $stableQt69Url . 'Nextcloud-' . $stableQt69Version . '-macOS-vfs.pkg.tbz',
156+
"signature" => $stableQt69VersionSignature,
157+
"length" => $stableQt69VersionLength,
158+
"fileProviderSignature" => $stableQt69VersionFileProviderSignature,
159+
"fileProviderLength" => $stableQt69VersionFileProviderLength,
160+
],
161+
],
131162
'stable' => [
132163
'release' => $stableReleaseDate,
133164
'linux' => [

src/Response.php

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -84,21 +84,16 @@ private function getUpdateVersion() : array {
8484
return [];
8585
}
8686

87-
// if outdated platform, hand out latest stable-qt5, no daily/beta possible
88-
if ($this->checkOldPlatform()) {
89-
$stable = $this->config[$this->oem]['stable-qt5'][$this->platform];
90-
$beta = null;
91-
$daily = null;
92-
$enterprise = null;
93-
} else if (version_compare($this->osVersion, '12.0', '<') &&
94-
version_compare($this->version, '3.14.0', '<') &&
95-
version_compare($this->config[$this->oem]['stable'][$this->platform]['version'], '3.14.0', '==')) {
96-
// Skip 3.14.0 for macOS < 12 when updating as we have an issue with the system requirement settings
97-
// Serve the prior version instead in the meantime (3.13.4)
98-
$stable = $this->config[$this->oem]['stable-qt5'][$this->platform];
99-
$beta = $this->config[$this->oem]['beta'][$this->platform];
100-
$daily = $this->config[$this->oem]['daily'][$this->platform];
101-
$enterprise = null;
87+
// if legacy platform, hand out its dedicated stable version; no daily/beta/enterprise
88+
$legacyChannel = $this->getLegacyChannel();
89+
if ($legacyChannel !== null) {
90+
if (!isset($this->config[$this->oem][$legacyChannel][$this->platform])) {
91+
return [];
92+
}
93+
$stable = $this->config[$this->oem][$legacyChannel][$this->platform];
94+
$beta = null;
95+
$daily = null;
96+
$enterprise = null;
10297
} else {
10398
$stable = $this->config[$this->oem]['stable'][$this->platform];
10499
$beta = $this->config[$this->oem]['beta'][$this->platform];
@@ -127,8 +122,8 @@ private function getUpdateVersion() : array {
127122
return [];
128123
}
129124

130-
private function checkOldPlatform(): bool {
131-
// Outdated platforms:
125+
private function getLegacyChannel(): ?string {
126+
// Outdated platforms (Qt5 era):
132127
// - macOS < 11
133128
// - Win < 10
134129
// - Win 10 (build number < 1809)
@@ -139,41 +134,46 @@ private function checkOldPlatform(): bool {
139134

140135
// Mac < 11
141136
if ($this->platform === "macos" && version_compare($this->osVersion, "11") == -1) {
142-
return true;
137+
return 'stable-qt5';
138+
}
139+
140+
// macOS 11/12 — not compatible with Qt6.10 (required by current stable)
141+
if ($this->platform === "macos" && version_compare($this->osVersion, "13") == -1) {
142+
return 'stable-qt6.9';
143143
}
144144

145145
// Windows <10
146146
if ($this->platform === "win32" && version_compare($this->osVersion, "10") == -1) {
147-
return true;
147+
return 'stable-qt5';
148148
}
149149

150150
// Windows 10 (build number < 1809)
151151
if ($this->platform === "win32" && version_compare($this->osVersion, "10") == 0 && version_compare($this->kernelVersion, '10.0.1809') == -1) {
152-
return true;
152+
return 'stable-qt5';
153153
}
154154

155155
// - Win 11 (build number < 17764)
156156
if ($this->platform === "win32" && version_compare($this->osVersion, "11") == 0 && version_compare($this->kernelVersion, '10.0.17764') == -1) {
157-
return true;
157+
return 'stable-qt5';
158158
}
159159

160160
// - Ubuntu <22.04
161161
if ($this->platform === "linux" && $this->osRelease == "ubuntu" && version_compare($this->osVersion, '22.04') == -1) {
162-
return true;
162+
return 'stable-qt5';
163163
}
164164

165165
// - RHEL <9.2
166166
if ($this->platform === "linux" && $this->osRelease == "rhel" && version_compare($this->osVersion, '9.2') == -1) {
167-
return true;
167+
return 'stable-qt5';
168168
}
169169

170170

171171
// - openSuse <15.5
172172
if ($this->platform === "linux" && $this->osRelease == "opensuse-leap" && version_compare($this->osVersion, '15.5') == -1) {
173-
return true;
173+
return 'stable-qt5';
174174
}
175175

176-
return false;
176+
return null;
177177
}
178178

179179
/**

tests/unit/ResponseTest.php

Lines changed: 80 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,18 @@ public function updateDataProvider(): array
3636
'length' => 62738920,
3737
]
3838
],
39-
'stable' => [
39+
'stable-qt6.9' => [
40+
'release' => '2024-06-01 01:01',
41+
'macos' => [
42+
'version' => '2.1.0.2000',
43+
'versionstring' => 'Nextcloud Client 2.1.0 (build 2000)',
44+
'downloadurl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg',
45+
'sparkleDownloadUrl' => 'https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz',
46+
'signature' => 'LEGACYMACSIG==',
47+
'length' => 55555555,
48+
],
49+
],
50+
'stable' => [
4051
'release' => '2019-02-24 17:05',
4152
'linux' => [
4253
'version' => '2.2.2',
@@ -207,7 +218,7 @@ public function updateDataProvider(): array
207218
false,
208219
$config,
209220
'<?xml version="1.0"?>
210-
<owncloudclient><version>2.2.2.3472</version><versionstring>Nextcloud Client 2.2.2 (build 3472)</versionstring><downloadurl>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg</downloadurl><sparkleDownloadUrl>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz</sparkleDownloadUrl><signature>MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=</signature><length>62738920</length></owncloudclient>
221+
<owncloudclient><version>2.1.0.2000</version><versionstring>Nextcloud Client 2.1.0 (build 2000)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</downloadurl><sparkleDownloadUrl>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz</sparkleDownloadUrl><signature>LEGACYMACSIG==</signature><length>55555555</length></owncloudclient>
211222
'
212223
],
213224
// #5
@@ -229,9 +240,9 @@ public function updateDataProvider(): array
229240
<description>Most recent changes with links to updates.</description>
230241
<language>en</language>
231242
<item>
232-
<title>Nextcloud Client 2.2.2 (build 3472)</title>
243+
<title>Nextcloud Client 2.1.0 (build 2000)</title>
233244
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
234-
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
245+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
235246
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
236247
</item>
237248
</channel>
@@ -400,9 +411,9 @@ public function updateDataProvider(): array
400411
<description>Most recent changes with links to updates.</description>
401412
<language>en</language>
402413
<item>
403-
<title>Nextcloud Client 2.2.2 (build 3472)</title>
414+
<title>Nextcloud Client 2.1.0 (build 2000)</title>
404415
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
405-
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
416+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
406417
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
407418
</item>
408419
</channel>
@@ -491,15 +502,15 @@ public function updateDataProvider(): array
491502
<description>Most recent changes with links to updates.</description>
492503
<language>en</language>
493504
<item>
494-
<title>Nextcloud Client 2.2.2 (build 3472)</title>
505+
<title>Nextcloud Client 2.1.0 (build 2000)</title>
495506
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
496-
<enclosure url="https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg.tbz" sparkle:version="2.2.2.3472" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
507+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
497508
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
498509
</item>
499510
</channel>
500511
</rss>'
501512
],
502-
// #21 Sparkle on, always needs to know what the latest version is
513+
// #21 macOS 12 (legacy) on beta channel with RC version — gets stable-qt6.9, not beta
503514
[
504515
'nextcloud',
505516
'macos',
@@ -518,15 +529,15 @@ public function updateDataProvider(): array
518529
<description>Most recent changes with links to updates.</description>
519530
<language>en</language>
520531
<item>
521-
<title>Nextcloud Client 2.2.2-rc2</title>
532+
<title>Nextcloud Client 2.1.0 (build 2000)</title>
522533
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
523-
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
534+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
524535
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
525536
</item>
526537
</channel>
527538
</rss>'
528539
],
529-
// #22 Sparkle on, always needs to know what the latest version is
540+
// #22 macOS 12 (legacy) on beta channel with stable version — gets stable-qt6.9, not beta
530541
[
531542
'nextcloud',
532543
'macos',
@@ -545,9 +556,9 @@ public function updateDataProvider(): array
545556
<description>Most recent changes with links to updates.</description>
546557
<language>en</language>
547558
<item>
548-
<title>Nextcloud Client 2.2.2-rc2</title>
559+
<title>Nextcloud Client 2.1.0 (build 2000)</title>
549560
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
550-
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
561+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
551562
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
552563
</item>
553564
</channel>
@@ -820,7 +831,7 @@ public function updateDataProvider(): array
820831
<owncloudclient><version>2.2.2.6192</version><versionstring>Nextcloud Client 2.2.2 (build 6192)</versionstring><downloadurl>https://download.nextcloud.com/desktop/stable/ownCloud-2.2.2.6192-setup.exe</downloadurl></owncloudclient>
821832
'
822833
],
823-
// #39 Again, Sparkle needs to know about the latest version
834+
// #39 macOS 11 (legacy) on enterprise channel — gets stable-qt6.9, not enterprise
824835
[
825836
'nextcloud',
826837
'macos',
@@ -833,6 +844,33 @@ public function updateDataProvider(): array
833844
false,
834845
$config,
835846
'<?xml version="1.0" encoding="utf-8"?>
847+
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
848+
<channel>
849+
<title>Download Channel</title>
850+
<description>Most recent changes with links to updates.</description>
851+
<language>en</language>
852+
<item>
853+
<title>Nextcloud Client 2.1.0 (build 2000)</title>
854+
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
855+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg.tbz" sparkle:version="2.1.0.2000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="LEGACYMACSIG==" length="55555555"/>
856+
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
857+
</item>
858+
</channel>
859+
</rss>'
860+
],
861+
// #40 macOS 13 — not legacy, gets regular stable via sparkle
862+
[
863+
'nextcloud',
864+
'macos',
865+
'1.9.0',
866+
'',
867+
'13.0',
868+
'22.00.00',
869+
'stable',
870+
true,
871+
false,
872+
$config,
873+
'<?xml version="1.0" encoding="utf-8"?>
836874
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
837875
<channel>
838876
<title>Download Channel</title>
@@ -845,6 +883,33 @@ public function updateDataProvider(): array
845883
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
846884
</item>
847885
</channel>
886+
</rss>'
887+
],
888+
// #41 macOS 13 — not legacy, gets regular beta via sparkle
889+
[
890+
'nextcloud',
891+
'macos',
892+
'2.2.2-rc1',
893+
'',
894+
'13.0',
895+
'22.00.00',
896+
'beta',
897+
true,
898+
false,
899+
$config,
900+
'<?xml version="1.0" encoding="utf-8"?>
901+
<rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
902+
<channel>
903+
<title>Download Channel</title>
904+
<description>Most recent changes with links to updates.</description>
905+
<language>en</language>
906+
<item>
907+
<title>Nextcloud Client 2.2.2-rc2</title>
908+
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
909+
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc1.pkg.tbz" sparkle:version="2.2.2-rc2" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
910+
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
911+
</item>
912+
</channel>
848913
</rss>'
849914
],
850915
];

0 commit comments

Comments
 (0)