diff options
author | Valentin Brandl <mail@vbrandl.net> | 2024-03-16 15:02:13 +0100 |
---|---|---|
committer | Valentin Brandl <mail@vbrandl.net> | 2024-03-16 15:02:13 +0100 |
commit | 46785f005a710e327ce2a825abcc49efef693d0c (patch) | |
tree | 187512a20326391b6ca959c4803436038fa087f8 /pkgs/applications/audio | |
parent | 3b48b3aaa9f53eefd61c334ece1a08b20f1a2e0c (diff) | |
download | nixlib-46785f005a710e327ce2a825abcc49efef693d0c.tar nixlib-46785f005a710e327ce2a825abcc49efef693d0c.tar.gz nixlib-46785f005a710e327ce2a825abcc49efef693d0c.tar.bz2 nixlib-46785f005a710e327ce2a825abcc49efef693d0c.tar.lz nixlib-46785f005a710e327ce2a825abcc49efef693d0c.tar.xz nixlib-46785f005a710e327ce2a825abcc49efef693d0c.tar.zst nixlib-46785f005a710e327ce2a825abcc49efef693d0c.zip |
Set date in package name to the date of the last commit
This will prevent "empty updates" such as https://github.com/NixOS/nixpkgs/pull/295215
Diffstat (limited to 'pkgs/applications/audio')
-rwxr-xr-x | pkgs/applications/audio/psst/update.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgs/applications/audio/psst/update.sh b/pkgs/applications/audio/psst/update.sh index a504b61c2410..4b10ca373be3 100755 --- a/pkgs/applications/audio/psst/update.sh +++ b/pkgs/applications/audio/psst/update.sh @@ -21,10 +21,15 @@ rev="$1" set -euo pipefail if [ -z "$rev" ]; then - rev="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/jpochyla/psst/commits?per_page=1" | jq -r '.[0].sha')" + response="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/jpochyla/psst/commits?per_page=1")" + rev="$(jq -r '.[0].sha' <<< "$response")" + date="$(jq -r '.[0].commit.author.date' <<< "$response" | cut -dT -f1)" +else + response="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/jpochyla/psst/commits/$rev")" + date="$(jq -r '.commit.author.date' <<< "$response" | cut -dT -f1)" fi -version="unstable-$(date +%F)" +version="unstable-$date" # Sources src_hash=$(nix-prefetch-github jpochyla psst --rev "$rev" | jq -r .hash) |