diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-02 12:42:58 -0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-02 12:42:58 -0400 |
commit | 6ec7460af1103a23e4d331e0c8a56283350175c5 (patch) | |
tree | c10a34cceed9819fcf4ff5b749ceddaf771d5583 /scripts/nix-push.in | |
parent | 6b1e671ac6cc0376474dd8c1403582ae1db01576 (diff) |
Binary caches: use a better key
Use the hash part of the store path as a key rather than a hash of the
store path. This is enough to get the desired privacy property.
Diffstat (limited to 'scripts/nix-push.in')
-rwxr-xr-x | scripts/nix-push.in | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scripts/nix-push.in b/scripts/nix-push.in index c388429ec..51106657b 100755 --- a/scripts/nix-push.in +++ b/scripts/nix-push.in @@ -218,12 +218,12 @@ for (my $n = 0; $n < scalar @storePaths; $n++) { } } - my $infoName = hashString("sha256", 1, $storePath); + my $pathHash = substr(basename($storePath), 0, 32); if ($localCopy) { - my $dst = "$localArchivesDir/$infoName.narinfo"; + my $dst = "$localArchivesDir/$pathHash.narinfo"; if ($force || ! -f $dst) { - my $tmp = "$localArchivesDir/.tmp.$$.$infoName"; + my $tmp = "$localArchivesDir/.tmp.$$.$pathHash.narinfo"; open INFO, ">$tmp" or die; print INFO "$info" or die; close INFO or die; |