From add7faf539a4bff2e8071000831b02bbb8742c11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edward=20Tj=C3=B6rnhammar?= Date: Tue, 19 Sep 2017 10:25:57 +0200 Subject: [PATCH] jetbrains: update.pl, make sure hashes are in base32 --- pkgs/applications/editors/jetbrains/update.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/editors/jetbrains/update.pl b/pkgs/applications/editors/jetbrains/update.pl index fecdeb0cae84..0c551d994a94 100755 --- a/pkgs/applications/editors/jetbrains/update.pl +++ b/pkgs/applications/editors/jetbrains/update.pl @@ -60,10 +60,13 @@ sub update_nix_block { die "$url still has some interpolation" if $url =~ /\$/; my ($sha256) = get("$url.sha256") =~ /^([0-9a-f]{64})/; - die "invalid sha256 in $url.sha256" unless $sha256; + my ($sha256Base32) = readpipe("nix-hash --type sha256 --to-base32 $sha256"); + chomp $sha256Base32; + print "Jetbrains published SHA256: $sha256\n"; + print "Conversion into base32 yeilds: $sha256Base32\n"; $block =~ s#version\s*=\s*"([^"]+)".+$#version = "$latest_versions{$channel}"; /* updated by script */#m; - $block =~ s#sha256\s*=\s*"([^"]+)".+$#sha256 = "$sha256"; /* updated by script */#m; + $block =~ s#sha256\s*=\s*"([^"]+)".+$#sha256 = "$sha256Base32"; /* updated by script */#m; } } return $block;