Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)

burpsuite: add updateScript

+41
+2
pkgs/by-name/bu/burpsuite/package.nix
··· 91 91 cp -r ${desktopItem}/share/applications $out/share 92 92 ''; 93 93 94 + passthru.updateScript = ./update.sh; 95 + 94 96 meta = with lib; { 95 97 inherit description; 96 98 longDescription = ''
+39
pkgs/by-name/bu/burpsuite/update.sh
··· 1 + #!/usr/bin/env nix-shell 2 + #!nix-shell -i bash -p curl jq xxd gnused diffutils 3 + set -eu -o pipefail 4 + 5 + SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)" 6 + 7 + curl -s 'https://portswigger.net/burp/releases/data' | 8 + jq -r ' 9 + [[ 10 + .ResultSet.Results[] 11 + | select( 12 + (.categories | sort) == (["Professional","Community"] | sort) 13 + and .releaseChannels == ["Early Adopter"] 14 + ) 15 + ][0].builds[] 16 + | select(.ProductPlatform == "Jar") 17 + ]' >latest.json 18 + 19 + version=$(jq -r '.[0].Version' latest.json) 20 + 21 + comm_hex=$(jq -r '.[] | select(.ProductId=="community") .Sha256Checksum' latest.json) 22 + pro_hex=$(jq -r '.[] | select(.ProductId=="pro") .Sha256Checksum' latest.json) 23 + 24 + comm_sri="sha256-$(printf %s "$comm_hex" | xxd -r -p | base64 -w0)" 25 + pro_sri="sha256-$(printf %s "$pro_hex" | xxd -r -p | base64 -w0)" 26 + 27 + sed -i \ 28 + -e "s|^\(\s*version = \)\"[^\"]*\";|\1\"$version\";|" \ 29 + -e "/productName = \"community\"/,/hash =/ { 30 + s|sha256-[^\"]*|$comm_sri| 31 + }" \ 32 + -e "/productName = \"pro\"/,/hash =/ { 33 + s|sha256-[^\"]*|$pro_sri| 34 + }" \ 35 + $SCRIPT_DIR/package.nix 36 + 37 + echo "burpsuite → $version" 38 + echo " community: $comm_sri" 39 + echo " pro : $pro_sri"