···3939# just for human consumption. Revision is just an integer that gets increased
4040# by one every (stable or unstable) release.
4141revision="${snap_info[0]}"
4242-sha512="${snap_info[1]}"
4242+# We need to escape the slashes
4343+hash="$(nix-hash --to-sri --type sha512 ${snap_info[1]} | sed 's|/|\\/|g')"
4344upstream_version="${snap_info[2]}"
4445last_updated="${snap_info[3]}"
4545-4646echo "Latest $channel release is $upstream_version from $last_updated."
4747-4847#
4948# read the current spotify version from the currently *committed* nix expression
5049#
···7069# search-and-replace revision, hash and version
7170sed --regexp-extended \
7271 -e 's/rev\s*=\s*"[0-9]+"\s*;/rev = "'"${revision}"'";/' \
7373- -e 's/sha512\s*=\s*"[^"]*"\s*;/sha512 = "'"${sha512}"'";/' \
7272+ -e 's/hash\s*=\s*"[^"]*"\s*;/hash = "'"${hash}"'";/' \
7473 -e 's/version\s*=\s*".*"\s*;/version = "'"${upstream_version}"'";/' \
7574 -i "$spotify_nix"
7675