-
-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sabnzbd: override sabctools version and add updateScript
- Loading branch information
1 parent
aaa57ba
commit 1eefa87
Showing
3 changed files
with
40 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env nix-shell | ||
#!nix-shell -i bash -p nix common-updater-scripts gnugrep gnused nurl | ||
|
||
# shellcheck shell=bash | ||
|
||
set -euo pipefail | ||
|
||
latestVersion=$(list-git-tags --url=https://github.com/sabnzbd/sabnzbd | grep -E '^[0-9.]+$' | sort --reverse --numeric-sort | head -n 1) | ||
currentVersion=$(nix-instantiate --eval -E "with import ./. {}; sabnzbd.version or (lib.getVersion sabnzbd)" | tr -d '"') | ||
|
||
if [[ "$latestVersion" == "$currentVersion" ]]; then | ||
echo "sabnzbd already latest version $latestVersion" | ||
exit 0 | ||
fi | ||
|
||
echo "sabnzbd updating $currentVersion -> $latestVersion" | ||
update-source-version sabnzbd "$latestVersion" | ||
|
||
sabctoolsVersion=$(curl -s "https://raw.githubusercontent.com/sabnzbd/sabnzbd/$latestVersion/requirements.txt" | grep sabctools | cut -f 3 -d =) | ||
sabctoolsHash=$(nurl --hash https://pypi.org/project/sabctools "$sabctoolsVersion") | ||
|
||
sed -i -E -e "s#sabctoolsVersion = \".*\"#sabctoolsVersion = \"$sabctoolsVersion\"#" ./pkgs/by-name/sa/sabnzbd/package.nix | ||
sed -i -E -e "s#sabctoolsHash = \".*\"#sabctoolsHash = \"$sabctoolsHash\"#" ./pkgs/by-name/sa/sabnzbd/package.nix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters