crc: fix update.sh not updating git hash

The update script correctly updated all version information,
but never updated the `hash` attribute for `fetchFromGitHub`,
causing the build to silently use the old version without
throwing any errors.

See https://github.com/NixOS/nixpkgs/pull/217528 for reference.
This commit is contained in:
Matthew Penner 2023-03-20 09:53:08 -06:00
parent 2cc1453302
commit eeeed328b4
No known key found for this signature in database

View file

@ -25,6 +25,9 @@ CRC_COMMIT=$(curl --silent ${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} \
https://api.github.com/repos/crc-org/crc/tags |
jq -r "map(select(.name == \"${LATEST_TAG_NAME}\")) | .[0] | .commit.sha")
CRC_GIT_PREFETCH=$(nix-prefetch-url --unpack https://github.com/crc-org/crc/archive/${CRC_COMMIT}.tar.gz)
CRC_GIT_HASH=$(nix hash to-sri --type sha256 ${CRC_GIT_PREFETCH})
FILE_MAKEFILE=${WORKDIR}/Makefile
curl --silent https://raw.githubusercontent.com/crc-org/crc/${CRC_COMMIT}/Makefile >$FILE_MAKEFILE
@ -46,6 +49,9 @@ sed -i "s|version = \".*\"|version = \"${CRC_VERSION:-}\"|" \
sed -i "s|gitCommit = \".*\"|gitCommit = \"${CRC_COMMIT:-}\"|" \
${NIXPKGS_CRC_FOLDER}/default.nix
sed -i "s|gitHash = \".*\"|gitHash = \"${CRC_GIT_HASH}\"|" \
${NIXPKGS_CRC_FOLDER}/default.nix
sed -i "s|openShiftVersion = \".*\"|openShiftVersion = \"${OPENSHIFT_VERSION:-}\"|" \
${NIXPKGS_CRC_FOLDER}/default.nix