From bf06bb0f8924be3e5c71d2009cf96381ad9c7990 Mon Sep 17 00:00:00 2001 From: BlankParticle Date: Thu, 5 Oct 2023 00:03:29 +0530 Subject: [PATCH] spotify: use hash instead of sha512 in update script --- pkgs/applications/audio/spotify/update.sh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/audio/spotify/update.sh b/pkgs/applications/audio/spotify/update.sh index 8c466e836cd2..9bd983755c71 100755 --- a/pkgs/applications/audio/spotify/update.sh +++ b/pkgs/applications/audio/spotify/update.sh @@ -39,12 +39,11 @@ snap_info=($( # just for human consumption. Revision is just an integer that gets increased # by one every (stable or unstable) release. revision="${snap_info[0]}" -sha512="${snap_info[1]}" +# We need to escape the slashes +hash="$(nix-hash --to-sri --type sha512 ${snap_info[1]} | sed 's|/|\\/|g')" upstream_version="${snap_info[2]}" last_updated="${snap_info[3]}" - echo "Latest $channel release is $upstream_version from $last_updated." - # # read the current spotify version from the currently *committed* nix expression # @@ -70,7 +69,7 @@ echo "Updating from ${current_nix_version} to ${upstream_version}, released on $ # search-and-replace revision, hash and version sed --regexp-extended \ -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \ - -e 's/sha512\s*=\s*"[^"]*"\s*;/sha512 = "'"${sha512}"'";/' \ + -e 's/hash\s*=\s*"[^"]*"\s*;/hash = "'"${hash}"'";/' \ -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \ -i "$spotify_nix"