From 217e40ec41eee9c115128d80f9ec0c0cee965917 Mon Sep 17 00:00:00 2001 From: Thiago Kenji Okada Date: Sat, 23 Jul 2022 12:25:22 +0100 Subject: [PATCH] _7zz: improve update.sh script --- pkgs/tools/archivers/7zz/update.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pkgs/tools/archivers/7zz/update.sh b/pkgs/tools/archivers/7zz/update.sh index bbc9804799ab..1a6d38ea6097 100755 --- a/pkgs/tools/archivers/7zz/update.sh +++ b/pkgs/tools/archivers/7zz/update.sh @@ -1,13 +1,14 @@ #! /usr/bin/env nix-shell -#! nix-shell -i bash -p coreutils gnused curl jq +#! nix-shell -i bash -p coreutils gnused curl jq nix-prefetch set -euo pipefail cd "$(dirname "${BASH_SOURCE[0]}")" DRV_DIR="$PWD" OLD_VERSION="$(sed -nE 's/\s*version = "(.*)".*/\1/p' ./default.nix)" - -NEW_VERSION="$(curl "https://sourceforge.net/projects/sevenzip/best_release.json" | jq '.platform_releases.linux.filename' -r | cut -d/ -f3)" +# The best_release.json is not always up-to-date +# In those cases you can force the version by calling `./update.sh ` +NEW_VERSION="${1:-$(curl 'https://sourceforge.net/projects/sevenzip/best_release.json' | jq '.platform_releases.linux.filename' -r | cut -d/ -f3)}" echo "comparing versions $OLD_VERSION => $NEW_VERSION" if [[ "$OLD_VERSION" == "$NEW_VERSION" ]]; then