python312Packages.types-aiobotocore: 2.15.2 -> 2.15.2.post3 (#361801)
[NixPkgs.git] / pkgs / by-name / sa / sabnzbd / update.sh
blobd4cd47cfb5e92dcd43d797a47dfaac841c319c56
1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p nix common-updater-scripts gnugrep gnused nurl
4 # shellcheck shell=bash
6 set -euo pipefail
8 latestVersion=$(list-git-tags --url=https://github.com/sabnzbd/sabnzbd | grep -E '^[0-9.]+$' | sort --reverse --numeric-sort | head -n 1)
9 currentVersion=$(nix-instantiate --eval -E "with import ./. {}; sabnzbd.version or (lib.getVersion sabnzbd)" | tr -d '"')
11 if [[ "$latestVersion" == "$currentVersion" ]]; then
12 echo "sabnzbd already latest version $latestVersion"
13 exit 0
16 echo "sabnzbd updating $currentVersion -> $latestVersion"
17 update-source-version sabnzbd "$latestVersion"
19 sabctoolsVersion=$(curl -s "https://raw.githubusercontent.com/sabnzbd/sabnzbd/$latestVersion/requirements.txt" | grep sabctools | cut -f 3 -d =)
20 sabctoolsHash=$(nurl --hash https://pypi.org/project/sabctools "$sabctoolsVersion")
22 sed -i -E -e "s#sabctoolsVersion = \".*\"#sabctoolsVersion = \"$sabctoolsVersion\"#" ./pkgs/by-name/sa/sabnzbd/package.nix
23 sed -i -E -e "s#sabctoolsHash = \".*\"#sabctoolsHash = \"$sabctoolsHash\"#" ./pkgs/by-name/sa/sabnzbd/package.nix