jetbrains: update.pl, make sure hashes are in base32

This commit is contained in:
Edward Tjörnhammar 2017-09-19 10:25:57 +02:00
parent d623220b78
commit add7faf539
No known key found for this signature in database
GPG Key ID: 7B82CE4A866B6845

View File

@ -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;