From 776f2865fdce024fd44998ffa6a7eeaa36d2563e Mon Sep 17 00:00:00 2001 From: paumr Date: Thu, 4 Apr 2024 18:30:48 +0200 Subject: [PATCH 1/2] archi: refactored update script --- pkgs/tools/misc/archi/update.sh | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/pkgs/tools/misc/archi/update.sh b/pkgs/tools/misc/archi/update.sh index c374bf5a7906..457afc100db3 100755 --- a/pkgs/tools/misc/archi/update.sh +++ b/pkgs/tools/misc/archi/update.sh @@ -12,14 +12,14 @@ if [[ "$latestVersion" == "$currentVersion" ]]; then exit 0 fi -hash_aarch64_darwin=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/Archi-Mac-Silicon-$latestVersion.dmg) -hash_x86_64_darwin=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/Archi-Mac-$latestVersion.dmg) -hash_x86_64_linux=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/Archi-Linux64-$latestVersion.tgz) - -update-source-version archi 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system=aarch64-darwin -update-source-version archi $latestVersion $hash_aarch64_darwin --system=aarch64-darwin -update-source-version archi 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system=x86_64-darwin -update-source-version archi $latestVersion $hash_x86_64_darwin --system=x86_64-darwin -update-source-version archi 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system=x86_64-linux -update-source-version archi $latestVersion $hash_x86_64_linux --system=x86_64-linux +for i in \ + "aarch64-darwin Archi-Mac-Silicon-$latestVersion.dmg" \ + "x86_64-darwin Archi-Mac-$latestVersion.dmg" \ + "x86_64-linux Archi-Linux64-$latestVersion.tgz" +do + set -- $i + hash=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/$2) + update-source-version archi 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system=$1 + update-source-version archi $latestVersion $hash --system=$1 +done From 36bb9527462a01de273a0a387386c02f7dc7a51e Mon Sep 17 00:00:00 2001 From: paumr Date: Thu, 4 Apr 2024 18:32:47 +0200 Subject: [PATCH 2/2] archi: bugfix - convert hash to SRI --- pkgs/tools/misc/archi/update.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/tools/misc/archi/update.sh b/pkgs/tools/misc/archi/update.sh index 457afc100db3..07d488637945 100755 --- a/pkgs/tools/misc/archi/update.sh +++ b/pkgs/tools/misc/archi/update.sh @@ -18,7 +18,8 @@ for i in \ "x86_64-linux Archi-Linux64-$latestVersion.tgz" do set -- $i - hash=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/$2) + prefetch=$(nix-prefetch-url https://www.archimatetool.com/downloads/archi/$latestVersion/$2) + hash=$(nix-hash --type sha256 --to-sri $prefetch) update-source-version archi 0 "sha256-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=" --system=$1 update-source-version archi $latestVersion $hash --system=$1