List the derivations a package upgrade would build

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 11:42:10 +01:00
co-authored by Claude Sonnet 5.5
parent 38e7613b34
commit 7b4ecee518
5 changed files with 23 additions and 5 deletions
+4
View File
@@ -73,10 +73,14 @@ type UpgradePreview struct {
Time string `json:"time"`
Download string `json:"download"`
Builds int `json:"builds"`
BuildNames []string `json:"buildNames"` // what would be built here
RebootNeeded bool `json:"rebootNeeded"`
Changes []UpgradeChange `json:"changes"`
}
// MoreBuilds is how many derivations are built that BuildNames does not name.
func (p UpgradePreview) MoreBuilds() int { return max(p.Builds-len(p.BuildNames), 0) }
func readUpgradeFile(path string, v any) bool {
data, err := os.ReadFile(path)
return err == nil && json.Unmarshal(data, v) == nil