python3.pkgs.scipy: Fix some issues in update script

This commit is contained in:
Doron Behar 2023-08-18 12:16:55 +03:00 committed by Frederik Rietdijk
parent 84503a6c46
commit 854302c4e6
2 changed files with 6 additions and 6 deletions

View file

@ -33,9 +33,7 @@ let
#
# nix-shell maintainers/scripts/update.nix --argstr package python3.pkgs.scipy
#
# Even if you do update these hashes manually, don't change their base
# (base16 or base64), because the update script uses sed regexes to replace
# them with the updated hashes.
# The update script uses sed regexes to replace them with the updated hashes.
version = "1.11.1";
srcHash = "sha256-bgnYXe3EhzL7+Gfriz1cXCl2eYQJ8zF+rcIwHyZR8bQ=";
datasetsHashes = {

View file

@ -16,10 +16,12 @@ if grep -q 'version = "'$version $fname; then
echo "Current version $version is the latest available, will update only datasets' hashes (don't take long)"
else
echoerr got version $version
sed -i -E 's/(version = ).*=/\1'$version'/g' $fname
sed -i -E 's/(version = ").*(";)/\1'$version'\2/g' $fname
# Verify the sed command above did not fail
grep -q $version $fname
# Update srcHash
srcHash='"sha256-'$(nix-prefetch-github scipy scipy --rev v${version} --fetch-submodules | jq --raw-output .sha256)'"'
sed -i 's/srcHash = .*=";/srcHash = '$srcHash';/g' $fname
srcHash="$(nix-prefetch-github scipy scipy --rev v${version} --fetch-submodules | jq --raw-output .hash)"
sed -i -E 's#(srcHash = ").*(";)#\1'$srcHash'\2#g' $fname
fi
for d in $datasets; do