Files
nixpkgs/pkgs/by-name/jd/jdt-language-server/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

22 lines
847 B
Bash
Executable File

#! /usr/bin/env nix-shell
#! nix-shell -i bash --pure -p curl cacert libxml2 yq nix jq
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
DRV_DIR="$PWD"
# scrape the downloads page for release info
newver=$(curl -s 'https://download.eclipse.org/jdtls/milestones/' | xmllint --html - --xmlout 2>/dev/null | xq --raw-output '.html.body.main.div.div.div[0].div.table.tr | max_by(.td[3]).td[1].a.["#text"]')
prefix="https://download.eclipse.org/jdtls/milestones/$newver"
filename=$(curl -s "$prefix/latest.txt")
newtimestamp=$(echo $filename | sed "s|^.*-$newver-||;s|\.tar\.gz$||")
newhash="$(nix-hash --to-sri --type sha256 $(nix-prefetch-url "$prefix/$filename"))";
sed -i package.nix \
-e "/^ version =/ s|\".*\"|\"$newver\"|" \
-e "/^ timestamp =/ s|\".*\"|\"$newtimestamp\"|" \
-e "/^ hash =/ s|\".*\"|\"$newhash\"|" \