Hide the system and build-only versions from the package list
The system's own path is not a package; its revision change is shown above the list. A version that continues another new one (5.6.0-go next to 5.6.0) is a build-time part of the same package. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AeFqV9dZrK6nipHkPfyM4F
This commit is contained in:
@@ -119,11 +119,15 @@ let
|
||||
def lines: split("\n") | map(select(. != "" and (test("\\.(tar|patch|diff|zip|tgz|tbz2?|txz|gz|xz|bz2|sh|py|nix|json|conf|asc|sig|lock)$") | not)));
|
||||
def strip: sub("-(bin|dev|lib|out|man|doc|info|devdoc|static|lib32|modules|modules-shrunk|libgcc|getent|debug)$"; "");
|
||||
def parse: capture("^(?<n>.*?)-(?<v>[0-9].*)$") // {n: ., v: ""};
|
||||
# Among the new versions of a package, one that continues another (5.6.0-go next
|
||||
# to 5.6.0) belongs to a build-time part of it (lego-5.6.0-go-modules).
|
||||
def own: . as $all | map(select(. as $v | $all | any(. as $p | $p != $v and ($v | startswith($p + "-"))) | not));
|
||||
def table: map(strip | parse) | group_by(.n) | map({key: .[0].n, value: (map(.v) | unique)}) | from_entries;
|
||||
($old | lines | table) as $o | ($new | lines | table) as $n
|
||||
| [ $o | to_entries[] | select($n[.key] != null and .value != [""])
|
||||
| select(((.value - $n[.key]) | length) == (.value | length) and (($n[.key] - .value) | length) > 0)
|
||||
| {name: .key, from: (.value | join(", ")), to: ($n[.key] - .value | join(", "))} ]
|
||||
| {name: .key, from: (.value | join(", ")), to: ($n[.key] - .value | own | join(", "))} ]
|
||||
| map(select(.name | startswith("nixos-system-") | not))
|
||||
| sort_by(.name)'
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@
|
||||
</form>
|
||||
<p class="hint">Works it out from the new revision's description: no package is downloaded.</p>
|
||||
{{with $d.Preview}}
|
||||
<p><strong>{{.Version}}</strong> <span class="muted">{{printf "%.7s" .Rev}}, previewed {{.Time}}</span></p>
|
||||
<p>{{$d.Version}} → <strong>{{.Version}}</strong> <span class="muted">{{printf "%.7s" .Rev}}, previewed {{.Time}}</span></p>
|
||||
{{if .Changes}}
|
||||
<table>
|
||||
<thead><tr><th>Package</th><th>Now</th><th></th><th>New</th></tr></thead>
|
||||
|
||||
+3
-3
@@ -395,11 +395,11 @@ pkgs.testers.runNixOSTest {
|
||||
target.succeed("test ! -e /var/lib/router/config/nixpkgs-pin.json")
|
||||
|
||||
with subtest("the package list names what changes in version, and only that"):
|
||||
target.succeed("printf '%s\\n' linux-6.12.5 openssl-3.4.1 openssl-3.4.1-bin zlib-1.3.1 frr-10.1 ripgrep-14.1 rg-1.0 glibc-2.40-66 glibc-2.40-66-getent > /tmp/old")
|
||||
target.succeed("printf '%s\\n' linux-6.12.8 openssl-3.4.2 zlib-1.3.1 zlib-1.3.2 frr-10.2 cmake-4.0 bash-5.3 glibc-2.40-66 foo-1.tar.gz > /tmp/new")
|
||||
target.succeed("printf '%s\\n' linux-6.12.5 openssl-3.4.1 openssl-3.4.1-bin zlib-1.3.1 frr-10.1 ripgrep-14.1 rg-1.0 glibc-2.40-66 glibc-2.40-66-getent lego-5.5.1 nixos-system-router-26.11.20261107.f4a03c0 > /tmp/old")
|
||||
target.succeed("printf '%s\\n' linux-6.12.8 openssl-3.4.2 zlib-1.3.1 zlib-1.3.2 frr-10.2 cmake-4.0 bash-5.3 glibc-2.40-66 foo-1.tar.gz lego-5.6.0 lego-5.6.0-go-modules nixos-system-router-26.11.20261113.d5cc683 > /tmp/new")
|
||||
target.succeed("sed -n '/^changes() {/,/^}/p' /run/current-system/sw/bin/router-upgrade > /tmp/changes.sh && test -s /tmp/changes.sh")
|
||||
out = target.succeed("bash -c 'source /tmp/changes.sh; changes /tmp/old /tmp/new' | jq -c 'map(.name + \":\" + .from + \">\" + .to)'")
|
||||
assert json.loads(out) == ["frr:10.1>10.2", "linux:6.12.5>6.12.8", "openssl:3.4.1>3.4.2"], out
|
||||
assert json.loads(out) == ["frr:10.1>10.2", "lego:5.5.1>5.6.0", "linux:6.12.5>6.12.8", "openssl:3.4.1>3.4.2"], out
|
||||
|
||||
with subtest("an upgrade that is not confirmed is rolled back, the lock and the pin included"):
|
||||
lock = target.succeed("cat /var/lib/router/config/flake.lock")
|
||||
|
||||
Reference in New Issue
Block a user