This repository has no description
0

Configure Feed

Select the types of activity you want to include in your feed.

pkgs.reaktor2: blessings 2.5.0 -> 2.6.0, add updateScript

+85 -3
+5 -3
pkgs/reaktor2/blessings.nix
··· 6 6 fetchgit, 7 7 hspec, 8 8 lib, 9 + mono-traversable, 9 10 QuickCheck, 10 11 text, 11 12 wcwidth, 12 13 }: 13 14 mkDerivation { 14 15 pname = "blessings"; 15 - version = "2.5.0"; 16 + version = "2.6.0"; 16 17 src = fetchgit { 17 18 url = "https://cgit.krebsco.de/blessings"; 18 - sha256 = "1spwm4xjz72c76wkkxxxbvxpgkxam344iwq37js5lhfbb2hbjqbx"; 19 - rev = "8f9b20f3aa93f7fbba9d24de7732f4cca0119154"; 19 + sha256 = "sha256-UO1DP6MbKfypKNRUyRfnksaeawje9nUkVZU3ApzIEhI="; 20 + rev = "35854c8df0c97ad99325f1bf3837d1e7efdaf21e"; 20 21 fetchSubmodules = true; 21 22 }; 22 23 libraryHaskellDepends = [ 23 24 base 24 25 bytestring 25 26 extra 27 + mono-traversable 26 28 text 27 29 wcwidth 28 30 ];
+1
pkgs/reaktor2/reaktor2.nix
··· 86 86 ]; 87 87 license = lib.licenses.mit; 88 88 mainProgram = "reaktor"; 89 + passthru.updateScript = ./update.sh; 89 90 }
+79
pkgs/reaktor2/update.sh
··· 1 + #!/usr/bin/env bash 2 + set -euo pipefail 3 + 4 + # Two cgit sources (reaktor2 + its blessings dependency) bumped together to 5 + # their latest release tags; nix-update can't handle the pair. 6 + attr=reaktor2 7 + 8 + # Run by update-pkgs from the flake root ($0 is a read-only store copy). 9 + dir=pkgs/reaktor2 10 + system=$(nix eval --raw --impure --expr 'builtins.currentSystem') 11 + build_attr=".#packages.$system.$attr" 12 + 13 + # Prints "<tag> <rev>" of the highest version tag (tags may or may not carry a 14 + # leading "v"; annotated tags resolve to the commit via ^{}). 15 + latest_tag() { 16 + git ls-remote --tags "$1" | 17 + awk '{ ref = $2; sub("^refs/tags/", "", ref); peeled = sub("\\^\\{\\}$", "", ref) 18 + if (peeled || !(ref in rev)) rev[ref] = $1 } 19 + END { for (t in rev) { v = t; sub("^v", "", v); print v, t, rev[t] } }' | 20 + sort -V -k1,1 | tail -n1 | cut -d' ' -f2- 21 + } 22 + 23 + changed=() 24 + bump() { 25 + local name=$1 file=$dir/$2 26 + local tag rev old_rev version 27 + read -r tag rev < <(latest_tag "https://cgit.krebsco.de/$name") 28 + version=${tag#v} 29 + old_rev=$(sed -n 's/^ *rev = "\([^"]*\)".*/\1/p' "$file") 30 + if [ "$old_rev" = "$rev" ]; then 31 + return 32 + fi 33 + # Blank the hash too: with the old one in place nix reuses the cached FOD. 34 + sed -i \ 35 + -e "s|^\( *\)rev = \".*\"|\1rev = \"$rev\"|" \ 36 + -e "s|^\( *\)version = \".*\"|\1version = \"$version\"|" \ 37 + -e "s|^\( *\)sha256 = \".*\"|\1sha256 = \"\"|" \ 38 + "$file" 39 + changed+=("$name") 40 + echo "$name: $old_rev -> $rev ($version)" 41 + } 42 + 43 + bump blessings blessings.nix 44 + bump reaktor2 reaktor2.nix 45 + 46 + if [ ${#changed[@]} -eq 0 ]; then 47 + echo "$attr: already up to date" 48 + exit 0 49 + fi 50 + 51 + # The probe build is *expected* to fail with a hash mismatch; print 52 + # "<drv-name> <got-hash>" of the first mismatching source. awk must not exit 53 + # early or tee dies of SIGPIPE. 54 + probe_hash() { 55 + { nix build --no-link "$build_attr" 2>&1 || true; } | tee /dev/stderr | 56 + awk '/hash mismatch in fixed-output derivation/ && !drv { match($0, /\/nix\/store\/[a-z0-9]+-[^'"'"']*/); drv = substr($0, RSTART + 44, RLENGTH - 44) } 57 + /got:/ && drv && !seen { print drv, $2; seen = 1 }' || true 58 + } 59 + 60 + for _ in "${changed[@]}"; do 61 + read -r drv got < <(probe_hash) || true 62 + if [ -z "${got:-}" ]; then 63 + break 64 + fi 65 + case $drv in 66 + blessings*) file=$dir/blessings.nix ;; 67 + reaktor2*) file=$dir/reaktor2.nix ;; 68 + *) 69 + echo "$attr: unexpected hash mismatch in $drv" >&2 70 + exit 1 71 + ;; 72 + esac 73 + sed -i "s|^\( *\)sha256 = \"[^\"]*\"|\1sha256 = \"$got\"|" "$file" 74 + echo "$attr: $drv hash -> $got" 75 + got= 76 + done 77 + 78 + nix build --no-link "$build_attr" 79 + echo "$attr: updated ${changed[*]}"