forked from lix-project/lix
* Fix nix-pull.
This commit is contained in:
parent
f4041cc175
commit
4d25b0b0bb
|
@ -15,8 +15,8 @@ my $manifest = "$tmpdir/manifest";
|
||||||
|
|
||||||
|
|
||||||
# Obtain URLs either from the command line or from a configuration file.
|
# Obtain URLs either from the command line or from a configuration file.
|
||||||
my %storePaths2urls;
|
my %narFiles;
|
||||||
my %urls2hashes;
|
my %patches;
|
||||||
my %successors;
|
my %successors;
|
||||||
|
|
||||||
sub processURL {
|
sub processURL {
|
||||||
|
@ -29,7 +29,7 @@ sub processURL {
|
||||||
"'$url' > '$manifest'") == 0
|
"'$url' > '$manifest'") == 0
|
||||||
or die "curl failed: $?";
|
or die "curl failed: $?";
|
||||||
|
|
||||||
readManifest $manifest, \%storePaths2urls, \%urls2hashes, \%successors;
|
readManifest $manifest, \%narFiles, \%patches, \%successors;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (@ARGV) {
|
while (@ARGV) {
|
||||||
|
@ -38,7 +38,7 @@ while (@ARGV) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
my $size = scalar (keys %storePaths2urls);
|
my $size = scalar (keys %narFiles);
|
||||||
print "$size store paths in manifest\n";
|
print "$size store paths in manifest\n";
|
||||||
|
|
||||||
|
|
||||||
|
@ -62,13 +62,16 @@ my $pid = open2(\*READ, \*WRITE, "@bindir@/nix-store --substitute")
|
||||||
|
|
||||||
close READ;
|
close READ;
|
||||||
|
|
||||||
foreach my $storePath (keys %storePaths2urls) {
|
foreach my $storePath (keys %narFiles) {
|
||||||
print WRITE "$storePath\n";
|
my $narFileList = $narFiles{$storePath};
|
||||||
print WRITE "$storeExpr\n";
|
foreach my $narFile (@{$narFileList}) {
|
||||||
print WRITE "/fetch\n";
|
print WRITE "$storePath\n";
|
||||||
print WRITE "2\n";
|
print WRITE "$storeExpr\n";
|
||||||
print WRITE "$storePaths2urls{$storePath}\n";
|
print WRITE "/fetch\n";
|
||||||
print WRITE "$urls2hashes{$storePaths2urls{$storePath}}\n";
|
print WRITE "2\n";
|
||||||
|
print WRITE "$narFile->{url}\n";
|
||||||
|
print WRITE "$narFile->{hash}\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
close WRITE;
|
close WRITE;
|
||||||
|
|
Loading…
Reference in a new issue