From 2280d5c467ff7d95ce4e1233408eae8fe98ddff1 Mon Sep 17 00:00:00 2001 From: aleksana Date: Thu, 4 Jul 2024 17:48:58 +0800 Subject: [PATCH] nuget-to-nix: generate SRI hash instead of sha256 --- pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh b/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh index 2754bfc32d7b..8cfbf649ad96 100755 --- a/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh +++ b/pkgs/build-support/dotnet/nuget-to-nix/nuget-to-nix.sh @@ -65,11 +65,11 @@ for package in *; do for source in "${remote_sources[@]}"; do url="${base_addresses[$source]}$package/$version/$package.$version.nupkg" if [[ "$source" == "$used_source" ]]; then - sha256="$(nix-hash --type sha256 --flat --base32 "$version/$package.$version".nupkg)" + hash="$(nix-hash --type sha256 --flat --sri "$version/$package.$version".nupkg)" found=true break else - if sha256=$(nix-prefetch-url "$url" 2>"$tmp"/error); then + if hash=$(nix-prefetch-url "$url" 2>"$tmp"/error); then # If multiple remote sources are enabled, nuget will try them all # concurrently and use the one that responds first. We always use the # first source that has the package. @@ -91,9 +91,9 @@ for package in *; do fi if [[ "$source" != https://api.nuget.org/v3/index.json ]]; then - echo " (fetchNuGet { pname = \"$id\"; version = \"$version\"; sha256 = \"$sha256\"; url = \"$url\"; })" + echo " (fetchNuGet { pname = \"$id\"; version = \"$version\"; hash = \"$hash\"; url = \"$url\"; })" else - echo " (fetchNuGet { pname = \"$id\"; version = \"$version\"; sha256 = \"$sha256\"; })" + echo " (fetchNuGet { pname = \"$id\"; version = \"$version\"; hash = \"$hash\"; })" fi done cd ..