From 46785f005a710e327ce2a825abcc49efef693d0c Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 16 Mar 2024 15:02:13 +0100 Subject: [PATCH 1/3] 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 --- pkgs/applications/audio/psst/update.sh | 9 +++++++-- 1 file 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) From 432b69499e1f4f953a761a2ba89230d70430a89c Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 16 Mar 2024 17:11:09 +0100 Subject: [PATCH 2/3] Downgrade version to the correct date --- pkgs/applications/audio/psst/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/audio/psst/default.nix b/pkgs/applications/audio/psst/default.nix index 46958b01bd1c..7abb8e78d161 100644 --- a/pkgs/applications/audio/psst/default.nix +++ b/pkgs/applications/audio/psst/default.nix @@ -16,7 +16,7 @@ let in rustPlatform.buildRustPackage rec { pname = "psst"; - version = "unstable-2024-03-04"; + version = "unstable-2024-02-11"; src = fetchFromGitHub { owner = "jpochyla"; From 42361fd8d90df53b0b902c3f89f335bd0ae45828 Mon Sep 17 00:00:00 2001 From: Valentin Brandl Date: Sat, 16 Mar 2024 17:11:55 +0100 Subject: [PATCH 3/3] Use the same logic to retreive the commit date --- pkgs/applications/audio/psst/update.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/audio/psst/update.sh b/pkgs/applications/audio/psst/update.sh index 4b10ca373be3..4ffa9417f040 100755 --- a/pkgs/applications/audio/psst/update.sh +++ b/pkgs/applications/audio/psst/update.sh @@ -21,14 +21,11 @@ rev="$1" set -euo pipefail if [ -z "$rev" ]; then - 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)" + rev="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/jpochyla/psst/commits?per_page=1" | jq -r '.[0].sha')" fi +date="$(wget -O- "${TOKEN_ARGS[@]}" "https://api.github.com/repos/jpochyla/psst/commits/$rev" | jq -r '.commit.author.date' | cut -dT -f1)" + version="unstable-$date" # Sources