1 #!/usr/bin/env nix-shell
2 #!nix-shell -i bash -p nix common-updater-scripts gnugrep gnused nurl
4 # shellcheck shell=bash
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"
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