Skip to content

Commit eb733b3

Browse files
authored
Merge pull request #243 from nextcloud/bugfix/noid/download-pkg-directly-33
fix(macOS): provide direct download of pkg to 33.0.0 and 33.0.1 releases
2 parents 4a133ae + 5cbd109 commit eb733b3

2 files changed

Lines changed: 77 additions & 1 deletion

File tree

src/Response.php

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,11 @@ private function getSparkleVersionString(array $updateVersion) : string {
211211
return $updateVersion[$updateLengthKey];
212212
}
213213

214+
private function getSparkleDownloadUrl(array $updateVersion) : string {
215+
$updateUrlKey = $this->isFileProvider ? 'fileProviderDownloadUrl' : 'downloadurl';
216+
return $updateVersion[$updateUrlKey];
217+
}
218+
214219
/**
215220
* Builds the response for Sparkle (used by the Mac updater)
216221
*
@@ -222,13 +227,21 @@ private function buildSparkleResponse(array $updateVersion) : string {
222227
$versionString = $this->getSparkleVersionString($updateVersion);
223228
$sparkleSignature = $this->getSparkleUpdateSignature($updateVersion);
224229
$sparkleLength = $this->getSparkleUpdateLength($updateVersion);
225-
230+
$updateurl = $this->getSparkleDownloadUrl($updateVersion);
231+
226232
$item = !empty($updateVersion) ? '
227233
<item>
228234
<title>'.$versionString.'</title>
229235
<pubDate>'.$this->getCurrentTimeStamp().'</pubDate>
230236
<enclosure url="'.$sparkleUrl.'" sparkle:version="'.$updateVersion['version'].'" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="'.$sparkleSignature.'" length="'.$sparkleLength.'"/>
231237
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
238+
<sparkle:informationalUpdate>
239+
<sparkle:version>33.0.0</sparkle:version>
240+
<sparkle:version>33.0.0.0</sparkle:version>
241+
<sparkle:version>33.0.1</sparkle:version>
242+
<sparkle:version>33.0.1.0</sparkle:version>
243+
</sparkle:informationalUpdate>
244+
<link>' . $updateurl . '</link>
232245
</item>' : '';
233246

234247
return '<?xml version="1.0" encoding="utf-8"?>

tests/unit/ResponseTest.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,6 +244,13 @@ public function updateDataProvider(): array
244244
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
245245
<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"/>
246246
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
247+
<sparkle:informationalUpdate>
248+
<sparkle:version>33.0.0</sparkle:version>
249+
<sparkle:version>33.0.0.0</sparkle:version>
250+
<sparkle:version>33.0.1</sparkle:version>
251+
<sparkle:version>33.0.1.0</sparkle:version>
252+
</sparkle:informationalUpdate>
253+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</link>
247254
</item>
248255
</channel>
249256
</rss>'
@@ -415,6 +422,13 @@ public function updateDataProvider(): array
415422
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
416423
<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"/>
417424
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
425+
<sparkle:informationalUpdate>
426+
<sparkle:version>33.0.0</sparkle:version>
427+
<sparkle:version>33.0.0.0</sparkle:version>
428+
<sparkle:version>33.0.1</sparkle:version>
429+
<sparkle:version>33.0.1.0</sparkle:version>
430+
</sparkle:informationalUpdate>
431+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</link>
418432
</item>
419433
</channel>
420434
</rss>'
@@ -506,6 +520,13 @@ public function updateDataProvider(): array
506520
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
507521
<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"/>
508522
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
523+
<sparkle:informationalUpdate>
524+
<sparkle:version>33.0.0</sparkle:version>
525+
<sparkle:version>33.0.0.0</sparkle:version>
526+
<sparkle:version>33.0.1</sparkle:version>
527+
<sparkle:version>33.0.1.0</sparkle:version>
528+
</sparkle:informationalUpdate>
529+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</link>
509530
</item>
510531
</channel>
511532
</rss>'
@@ -533,6 +554,13 @@ public function updateDataProvider(): array
533554
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
534555
<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"/>
535556
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
557+
<sparkle:informationalUpdate>
558+
<sparkle:version>33.0.0</sparkle:version>
559+
<sparkle:version>33.0.0.0</sparkle:version>
560+
<sparkle:version>33.0.1</sparkle:version>
561+
<sparkle:version>33.0.1.0</sparkle:version>
562+
</sparkle:informationalUpdate>
563+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</link>
536564
</item>
537565
</channel>
538566
</rss>'
@@ -560,6 +588,13 @@ public function updateDataProvider(): array
560588
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
561589
<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"/>
562590
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
591+
<sparkle:informationalUpdate>
592+
<sparkle:version>33.0.0</sparkle:version>
593+
<sparkle:version>33.0.0.0</sparkle:version>
594+
<sparkle:version>33.0.1</sparkle:version>
595+
<sparkle:version>33.0.1.0</sparkle:version>
596+
</sparkle:informationalUpdate>
597+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</link>
563598
</item>
564599
</channel>
565600
</rss>'
@@ -683,6 +718,13 @@ public function updateDataProvider(): array
683718
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
684719
<enclosure url="https://download.nextcloud.com/desktop/stable/Nextcloud-2.0.0.0000.pkg.tbz" sparkle:version="2.0.0.0000" type="application/octet-stream" sparkle:installationType="package" sparkle:edSignature="MC0CFQDmXR6biDmNVW7TvMh0bfPPTzCvtwIUCzASgpzYdi4lltOnwbFCeQwgDjY=" length="62738920"/>
685720
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
721+
<sparkle:informationalUpdate>
722+
<sparkle:version>33.0.0</sparkle:version>
723+
<sparkle:version>33.0.0.0</sparkle:version>
724+
<sparkle:version>33.0.1</sparkle:version>
725+
<sparkle:version>33.0.1.0</sparkle:version>
726+
</sparkle:informationalUpdate>
727+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.0.0.0000.pkg</link>
686728
</item>
687729
</channel>
688730
</rss>'
@@ -870,6 +912,13 @@ public function updateDataProvider(): array
870912
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
871913
<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"/>
872914
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
915+
<sparkle:informationalUpdate>
916+
<sparkle:version>33.0.0</sparkle:version>
917+
<sparkle:version>33.0.0.0</sparkle:version>
918+
<sparkle:version>33.0.1</sparkle:version>
919+
<sparkle:version>33.0.1.0</sparkle:version>
920+
</sparkle:informationalUpdate>
921+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.1.0.2000.pkg</link>
873922
</item>
874923
</channel>
875924
</rss>'
@@ -897,6 +946,13 @@ public function updateDataProvider(): array
897946
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
898947
<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"/>
899948
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
949+
<sparkle:informationalUpdate>
950+
<sparkle:version>33.0.0</sparkle:version>
951+
<sparkle:version>33.0.0.0</sparkle:version>
952+
<sparkle:version>33.0.1</sparkle:version>
953+
<sparkle:version>33.0.1.0</sparkle:version>
954+
</sparkle:informationalUpdate>
955+
<link>https://download.owncloud.com/desktop/stable/ownCloud-2.2.2.3472.pkg</link>
900956
</item>
901957
</channel>
902958
</rss>'
@@ -924,6 +980,13 @@ public function updateDataProvider(): array
924980
<pubDate>Wed, 13 July 16 21:07:31 +0200</pubDate>
925981
<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"/>
926982
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
983+
<sparkle:informationalUpdate>
984+
<sparkle:version>33.0.0</sparkle:version>
985+
<sparkle:version>33.0.0.0</sparkle:version>
986+
<sparkle:version>33.0.1</sparkle:version>
987+
<sparkle:version>33.0.1.0</sparkle:version>
988+
</sparkle:informationalUpdate>
989+
<link>https://download.nextcloud.com/desktop/stable/Nextcloud-2.2.2-rc2.pkg</link>
927990
</item>
928991
</channel>
929992
</rss>'

0 commit comments

Comments
 (0)