1#!/usr/bin/env nix-shell
2#!nix-shell -i bash -p curl nurl pup common-updater-scripts
3
4# partially taken from jitsi-meet/update.sh, as they both scrape an apt repo.
5
6set -euo pipefail
7
8version="$(curl https://josm.openstreetmap.de/apt/pool/universe/j/josm/ |
9 pup 'a[href] text{}' |
10 sed -nr 's/josm_[0-9]+.[0-9]+.svn([0-9]+)_all.deb/\1/p' |
11 sort -n |
12 tail -n1)"
13
14pkgHash="$(nurl -H https://github.com/JOSM/josm "$version-tested")"
15
16update-source-version josm "$version" --source-key=srcs.jar
17update-source-version josm "$version" --ignore-same-version --source-key=srcs.macosx
18update-source-version josm "$version" "$pkgHash" --ignore-same-version --source-key=srcs.pkg