2022-03-30 09:31:56 +00:00
|
|
|
#! /usr/bin/env nix-shell
|
2024-06-20 14:57:18 +00:00
|
|
|
#! nix-shell -I nixpkgs=./. -i bash -p curl xq-xml common-updater-scripts
|
2022-03-30 09:31:56 +00:00
|
|
|
set -euo pipefail
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
OLD_VERSION="$(nix-instantiate --eval --json --expr 'let pkgs = import ./. {}; in pkgs._7zz.version' | sed 's/"//g')"
|
2024-06-05 15:53:02 +00:00
|
|
|
NEW_VERSION="$(curl -H 'Accept: application/rss+xml' 'https://sourceforge.net/projects/sevenzip/rss?path=/7-Zip' | xq -x "substring((/rss/channel/item[link[contains(., 'src.tar.xz')]])[1]/title, 8, 5)")"
|
2022-03-30 09:31:56 +00:00
|
|
|
|
|
|
|
echo "comparing versions $OLD_VERSION => $NEW_VERSION"
|
|
|
|
if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then
|
|
|
|
echo "Already up to date! Doing nothing"
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
2024-06-20 14:57:18 +00:00
|
|
|
update-source-version _7zz "$NEW_VERSION"
|
|
|
|
update-source-version _7zz-rar "$NEW_VERSION" --ignore-same-version
|