forked from lix-project/lix
* nix-push: no need to compute the NAR hash, since the Nix database
already has it (`nix-store -q --hash').
This commit is contained in:
parent
e60c962fb8
commit
5693b8a7e2
|
@ -7,8 +7,6 @@ dst=$out/tmp.nar.bz2
|
||||||
|
|
||||||
@bzip2@ < tmp > $dst
|
@bzip2@ < tmp > $dst
|
||||||
|
|
||||||
@bindir@/nix-hash -vvvvv --flat --type $hashAlgo --base32 tmp > $out/nar-hash
|
|
||||||
|
|
||||||
@bindir@/nix-hash --flat --type $hashAlgo --base32 $dst > $out/narbz2-hash
|
@bindir@/nix-hash --flat --type $hashAlgo --base32 $dst > $out/narbz2-hash
|
||||||
|
|
||||||
@coreutils@/mv $out/tmp.nar.bz2 $out/$(@coreutils@/cat $out/narbz2-hash).nar.bz2
|
@coreutils@/mv $out/tmp.nar.bz2 $out/$(@coreutils@/cat $out/narbz2-hash).nar.bz2
|
||||||
|
|
|
@ -172,12 +172,6 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
|
||||||
$narbz2Hash =~ /^[0-9a-z]+$/ or die "invalid hash";
|
$narbz2Hash =~ /^[0-9a-z]+$/ or die "invalid hash";
|
||||||
close HASH;
|
close HASH;
|
||||||
|
|
||||||
open HASH, "$narDir/nar-hash" or die "cannot open nar-hash";
|
|
||||||
my $narHash = <HASH>;
|
|
||||||
chomp $narHash;
|
|
||||||
$narHash =~ /^[0-9a-z]+$/ or die "invalid hash";
|
|
||||||
close HASH;
|
|
||||||
|
|
||||||
my $narName = "$narbz2Hash.nar.bz2";
|
my $narName = "$narbz2Hash.nar.bz2";
|
||||||
|
|
||||||
my $narFile = "$narDir/$narName";
|
my $narFile = "$narDir/$narName";
|
||||||
|
@ -195,6 +189,10 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
|
||||||
chomp $deriver;
|
chomp $deriver;
|
||||||
$deriver = "" if $deriver eq "unknown-deriver";
|
$deriver = "" if $deriver eq "unknown-deriver";
|
||||||
|
|
||||||
|
my $narHash = `$binDir/nix-store --query --hash '$storePath'`;
|
||||||
|
die "cannot query hash for `$storePath'" if $? != 0;
|
||||||
|
chomp $narHash;
|
||||||
|
|
||||||
my $url;
|
my $url;
|
||||||
if ($localCopy) {
|
if ($localCopy) {
|
||||||
$url = "$targetArchivesUrl/$narName";
|
$url = "$targetArchivesUrl/$narName";
|
||||||
|
@ -205,7 +203,7 @@ for (my $n = 0; $n < scalar @storePaths; $n++) {
|
||||||
{ url => $url
|
{ url => $url
|
||||||
, hash => "$hashAlgo:$narbz2Hash"
|
, hash => "$hashAlgo:$narbz2Hash"
|
||||||
, size => $narbz2Size
|
, size => $narbz2Size
|
||||||
, narHash => "$hashAlgo:$narHash"
|
, narHash => "$narHash"
|
||||||
, references => $references
|
, references => $references
|
||||||
, deriver => $deriver
|
, deriver => $deriver
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue