Skip to content

Commit

Permalink
file provider VFS macOS has its own version
Browse files Browse the repository at this point in the history
we need to send a different update release for macOS classic and macOS
VFS clients

Signed-off-by: Matthieu Gallien <[email protected]>
  • Loading branch information
mgallien committed Jul 3, 2024
1 parent acd6166 commit 97b4fc2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

$stableReleaseDate = '2024-07-02 10:00';
$stableVersion = '3.13.1';
$fileProviderStableReleaseDate = '2024-04-24 14:00';
$fileProviderStableVersion = '3.13.0';

$betaReleaseDate = '2024-04-13 15:00';
$betaVersionInternal = '3.12.81';
Expand All @@ -34,6 +36,7 @@
$dailyUrl = "https://download.nextcloud.com/desktop/daily/";

$stableVersionString = 'Nextcloud Client ' . $stableVersion;
$fileProviderStableVersionString = 'Nextcloud Client ' . $fileProviderStableVersion;
$betaVersionString = 'Nextcloud Client ' . $betaVersion;

if (version_compare($version, '3.0.3') < 0) {
Expand Down Expand Up @@ -87,11 +90,12 @@
'macos' => [
'version' => $stableVersion,
'versionstring' => $stableVersionString,
"fileProviderVersionString" => $fileProviderStableVersionString,
'downloadurl' => $stable_mac_url . 'Nextcloud-' . $stableVersion . '.pkg',
'fileProviderDownloadUrl' => $stable_mac_url . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg',
'fileProviderDownloadUrl' => $stable_mac_url . 'Nextcloud-' . $fileProviderStableVersion . '-macOS-vfs.pkg',
'web' => 'https://nextcloud.com/install',
"sparkleDownloadUrl" => $stable_mac_url . 'Nextcloud-' . $stableVersion . '.pkg.tbz',
"fileProviderSparkleDownloadUrl" => $stable_mac_url . 'Nextcloud-' . $stableVersion . '-macOS-vfs.pkg.tbz',
"fileProviderSparkleDownloadUrl" => $stable_mac_url . 'Nextcloud-' . $fileProviderStableVersion . '-macOS-vfs.pkg.tbz',
"signature" => "++voffbxHKaURwb+EAVtj5uvvCZTRKIY6LUMNQx1dt8lnJyxv2vlCmJxydfM/oOPLkYrE9PAhqTHFNmmX6QXCA==",
"fileProviderSignature" => "mHJDtEbZDnWElr2MQa44kEHp6wOwbPae+CYyLZbueeFuT+K8Us3icimrcQ8uBU1vb0UNay5j6L+dVhf9VO8qBw==",
"length" => 64626206,
Expand Down
8 changes: 7 additions & 1 deletion src/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,11 @@ private function getSparkleUpdateLength(array $updateVersion) : int {
return $updateVersion[$updateLengthKey];
}

private function getSparkleVersionString(array $updateVersion) : string {
$updateLengthKey = $this->isFileProvider ? 'fileProviderVersionString' : 'versionstring';
return $updateVersion[$updateLengthKey];
}

/**
* Builds the response for Sparkle (used by the Mac updater)
*
Expand All @@ -139,12 +144,13 @@ private function getSparkleUpdateLength(array $updateVersion) : int {
*/
private function buildSparkleResponse(array $updateVersion) : string {
$sparkleUrl = $this->getSparkleUpdateUrl($updateVersion);
$versionString = $this->getSparkleVersionString($updateVersion);
$sparkleSignature = $this->getSparkleUpdateSignature($updateVersion);
$sparkleLength = $this->getSparkleUpdateLength($updateVersion);

$item = !empty($updateVersion) ? '
<item>
<title>'.$updateVersion['versionstring'].'</title>
<title>'.$versionString.'</title>
<pubDate>'.$this->getCurrentTimeStamp().'</pubDate>
<enclosure url="'.$sparkleUrl.'" sparkle:version="'.$updateVersion['version'].'" type="application/octet-stream" sparkle:edSignature="'.$sparkleSignature.'" length="'.$sparkleLength.'"/>
<sparkle:minimumSystemVersion>11.0</sparkle:minimumSystemVersion>
Expand Down

0 comments on commit 97b4fc2

Please sign in to comment.