graalvmCEPackages: some fixes to update.sh script

This commit is contained in:
Thiago Kenji Okada 2023-09-28 16:03:54 +01:00
parent 8c01dd912f
commit 6a8719229c
6 changed files with 10 additions and 9 deletions

View File

@ -1,4 +1,4 @@
# Generated by ./update.sh script
# Generated by update.sh script
{
"version" = "23.1.0";
"hashes" = {

View File

@ -1,4 +1,4 @@
# Generated by ./update.sh script
# Generated by update.sh script
{
"version" = "23.1.0";
"hashes" = {

View File

@ -1,4 +1,4 @@
# Generated by ./update.sh script
# Generated by update.sh script
{
"version" = "23.1.0";
"hashes" = {

View File

@ -1,4 +1,4 @@
# Generated by ./update.sh script
# Generated by update.sh script
{
"version" = "21.0.0";
"hashes" = {

View File

@ -1,4 +1,4 @@
# Generated by ./update.sh script
# Generated by update.sh script
{
"version" = "23.1.0";
"hashes" = {

View File

@ -5,9 +5,9 @@
# ./update.sh [PRODUCT]
#
# Examples:
# $ ./update.sh graalvm-ce # will generate ./hashes-graalvm-ce.nix
# $ ./update.sh graalvm-ce # will generate ./graalvm-ce/hashes.nix
# $ ./update.sh # same as above
# $ ./update.sh graalpy # will generate ./hashes-graalpy.nix
# $ ./update.sh graalpy # will generate ./graalpy/hashes.nix
#
# Environment variables:
# FORCE=1 to force the update of a product (e.g.: skip up-to-date checks)
@ -17,6 +17,7 @@ set -eou pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"
tmpfile="$(mktemp --suffix=.nix)"
readonly tmpfile
trap 'rm -rf "$tmpfile"' EXIT
@ -95,7 +96,7 @@ fi
info "Generating '$hashes_nix' file for '$product' $new_version. This will take a while..."
# Indentation of `echo_file` function is on purpose to make it easier to visualize the output
echo_file "# Generated by $0 script"
echo_file "# Generated by $(basename $0) script"
echo_file "{"
echo_file " \"version\" = \"$new_version\";"
url="${products_urls["${product}"]}"
@ -106,7 +107,7 @@ for nix_platform in "${!platforms[@]}"; do
# Get current hashes to skip derivations already in /nix/store to reuse cache when the version is the same
# e.g.: when adding a new product and running this script with FORCE=1
if [[ "$current_version" == "$new_version" ]] && \
previous_hash="$(nix-instantiate --eval "$hashes_nix" -A "$product.$nix_platform.sha256" --json | jq -r)"; then
previous_hash="$(nix-instantiate --eval "$hashes_nix" -A "hashes.$nix_platform.sha256" --json | jq -r)"; then
args+=("$previous_hash" "--type" "sha256")
else
info "Hash in '$product' for '$nix_platform' not found. Re-downloading it..."