Ignore a package preview made by another nixos-router

A preview is kept until the next one; after an update it could still show
the list the older version made.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
2026-11-18 09:00:44 +01:00
co-authored by Claude Sonnet 5.5
parent 6e097b7473
commit 163df5966d
3 changed files with 26 additions and 5 deletions
+3 -2
View File
@@ -190,10 +190,11 @@ let
builds=$(grep -cE '^ +/nix/store/[^ ]*\.drv$' <<<"$dry" || true)
echo " to fetch: ''${download:-nothing, or no cache reachable}; to build here: $builds"
jq -n --arg channel "$channel" --arg rev "$newest" --arg ref "$pin" --arg version "$new_version" \
release_version=$(jq -r '.version // ""' /etc/router-release 2>/dev/null || true)
jq -n --arg channel "$channel" --arg release "$release_version" --arg rev "$newest" --arg ref "$pin" --arg version "$new_version" \
--arg time "$(date -u +%FT%TZ)" --arg download "$download" --argjson builds "$builds" \
--argjson reboot "$reboot" --slurpfile changes ${dir}/changes.json \
'{channel: $channel, rev: $rev, ref: $ref, version: $version, time: $time, download: $download,
'{channel: $channel, release: $release, rev: $rev, ref: $ref, version: $version, time: $time, download: $download,
builds: $builds, rebootNeeded: $reboot, changes: $changes[0]}' > ${dir}/preview.json
echo "$new_version$([ "$reboot" = false ] || echo ' (a new kernel runs after a reboot)'): router-upgrade apply activates it"
}