From 63b0baceede733d28e4aa0fef3b3b094311bd5e5 Mon Sep 17 00:00:00 2001 From: Jonathan Miller Date: Sun, 24 May 2026 23:03:19 -0500 Subject: [PATCH] fix: updates_xml_build writes only the current channel entry Was cascading entries for all lower channels on stable release, producing wrong download URLs for non-existent channel releases. Now writes only the entry for the current stability level; the preserve logic retains entries from other channels. Authored-by: Moko Consulting Co-Authored-By: Claude Opus 4.6 (1M context) --- cli/updates_xml_build.php | 45 +++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 23 deletions(-) diff --git a/cli/updates_xml_build.php b/cli/updates_xml_build.php index bbeb53d..7d42617 100644 --- a/cli/updates_xml_build.php +++ b/cli/updates_xml_build.php @@ -290,31 +290,30 @@ $allChannels = ['development', 'alpha', 'beta', 'rc', 'stable']; $stabilityIndex = array_search($stability === 'development' ? 'development' : $stability, $allChannels); if ($stabilityIndex === false) $stabilityIndex = 4; // default to stable -// Write entries for this stability and all below it +// Write only the current channel entry (not cascade) +// Each channel release only creates its own entry; preserved entries handle other channels $entries = []; -for ($i = 0; $i <= $stabilityIndex; $i++) { - $channelName = $allChannels[$i]; - $channelSuffix = $stabilitySuffixMap[$channelName] ?? ''; - $channelVersion = $version . $channelSuffix; - $channelTag = $stabilityTagMap[$channelName] ?? $channelName; - $channelDownloadUrl = "{$giteaUrl}/{$org}/{$repo}/releases/download/{$channelTag}/{$typePrefix}{$extElement}-{$channelVersion}.zip"; - $channelInfoUrl = "{$giteaUrl}/{$org}/{$repo}/releases/tag/{$channelTag}"; +$channelName = $allChannels[$stabilityIndex]; +$channelSuffix = $stabilitySuffixMap[$channelName] ?? ''; +$channelVersion = $version . $channelSuffix; +$channelTag = $stabilityTagMap[$channelName] ?? $channelName; +$channelDownloadUrl = "{$giteaUrl}/{$org}/{$repo}/releases/download/{$channelTag}/{$typePrefix}{$extElement}-{$channelVersion}.zip"; +$channelInfoUrl = "{$giteaUrl}/{$org}/{$repo}/releases/tag/{$channelTag}"; - $entries[] = buildEntry( - $channelName, - $channelVersion, - $channelDownloadUrl, - $extName, - $extElement, - $extType, - $clientTag, - $folderTag, - $channelInfoUrl, - $targetPlatform, - $phpTag, - $shaTag - ); -} +$entries[] = buildEntry( + $channelName, + $channelVersion, + $channelDownloadUrl, + $extName, + $extElement, + $extType, + $clientTag, + $folderTag, + $channelInfoUrl, + $targetPlatform, + $phpTag, + $shaTag +); // -- Preserve existing entries for channels not being updated ----------------- $dest = $outputFile ?? "{$root}/updates.xml";