spotify: use hash instead of sha512 in update script

+3 -4
+3 -4
pkgs/applications/audio/spotify/update.sh
··· 39 # just for human consumption. Revision is just an integer that gets increased 40 # by one every (stable or unstable) release. 41 revision="${snap_info[0]}" 42 - sha512="${snap_info[1]}" 43 upstream_version="${snap_info[2]}" 44 last_updated="${snap_info[3]}" 45 - 46 echo "Latest $channel release is $upstream_version from $last_updated." 47 - 48 # 49 # read the current spotify version from the currently *committed* nix expression 50 # ··· 70 # search-and-replace revision, hash and version 71 sed --regexp-extended \ 72 -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \ 73 - -e 's/sha512\s*=\s*"[^"]*"\s*;/sha512 = "'"${sha512}"'";/' \ 74 -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \ 75 -i "$spotify_nix" 76
··· 39 # just for human consumption. Revision is just an integer that gets increased 40 # by one every (stable or unstable) release. 41 revision="${snap_info[0]}" 42 + # We need to escape the slashes 43 + hash="$(nix-hash --to-sri --type sha512 ${snap_info[1]} | sed 's|/|\\/|g')" 44 upstream_version="${snap_info[2]}" 45 last_updated="${snap_info[3]}" 46 echo "Latest $channel release is $upstream_version from $last_updated." 47 # 48 # read the current spotify version from the currently *committed* nix expression 49 # ··· 69 # search-and-replace revision, hash and version 70 sed --regexp-extended \ 71 -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \ 72 + -e 's/hash\s*=\s*"[^"]*"\s*;/hash = "'"${hash}"'";/' \ 73 -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \ 74 -i "$spotify_nix" 75