Files
nixpkgs/pkgs/by-name/bu/burpsuite/update.sh
Dark Steveneq 646b892680
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s
push sheeet
2025-10-09 14:15:47 +02:00

40 lines
1.2 KiB
Bash
Executable File

#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl jq xxd gnused diffutils
set -eu -o pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
curl -s 'https://portswigger.net/burp/releases/data' |
jq -r '
[[
.ResultSet.Results[]
| select(
(.categories | sort) == (["Professional","Community"] | sort)
and .releaseChannels == ["Early Adopter"]
)
][0].builds[]
| select(.ProductPlatform == "Jar")
]' >latest.json
version=$(jq -r '.[0].Version' latest.json)
comm_hex=$(jq -r '.[] | select(.ProductId=="community") .Sha256Checksum' latest.json)
pro_hex=$(jq -r '.[] | select(.ProductId=="pro") .Sha256Checksum' latest.json)
comm_sri="sha256-$(printf %s "$comm_hex" | xxd -r -p | base64 -w0)"
pro_sri="sha256-$(printf %s "$pro_hex" | xxd -r -p | base64 -w0)"
sed -i \
-e "s|^\(\s*version = \)\"[^\"]*\";|\1\"$version\";|" \
-e "/productName = \"community\"/,/hash =/ {
s|sha256-[^\"]*|$comm_sri|
}" \
-e "/productName = \"pro\"/,/hash =/ {
s|sha256-[^\"]*|$pro_sri|
}" \
$SCRIPT_DIR/package.nix
echo "burpsuite → $version"
echo " community: $comm_sri"
echo " pro : $pro_sri"