summary refs log tree commit diff
path: root/scripts/nix-pull.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2004-12-16 15:31:50 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2004-12-16 15:31:50 +0000
commit4d25b0b0bb9977598802b0d9647530f7c2fde430 (patch)
treecbb62aaa3b18f31fa4facfe15d90e90a81093bf2 /scripts/nix-pull.in
parentf4041cc175df8bc3fa5810948cc2a33eb1159a06 (diff)
downloadguix-4d25b0b0bb9977598802b0d9647530f7c2fde430.tar.gz
* Fix nix-pull.
Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r--scripts/nix-pull.in25
1 files changed, 14 insertions, 11 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 82b6e8435b..a06ee7e575 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -15,8 +15,8 @@ my $manifest = "$tmpdir/manifest";
 
 
 # Obtain URLs either from the command line or from a configuration file.
-my %storePaths2urls;
-my %urls2hashes;
+my %narFiles;
+my %patches;
 my %successors;
 
 sub processURL {
@@ -29,7 +29,7 @@ sub processURL {
            "'$url' > '$manifest'") == 0
            or die "curl failed: $?";
     
-    readManifest $manifest, \%storePaths2urls, \%urls2hashes, \%successors;
+    readManifest $manifest, \%narFiles, \%patches, \%successors;
 }
 
 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";
 
 
@@ -62,13 +62,16 @@ my $pid = open2(\*READ, \*WRITE, "@bindir@/nix-store --substitute")
 
 close READ;
 
-foreach my $storePath (keys %storePaths2urls) {
-    print WRITE "$storePath\n";
-    print WRITE "$storeExpr\n";
-    print WRITE "/fetch\n";
-    print WRITE "2\n";
-    print WRITE "$storePaths2urls{$storePath}\n";
-    print WRITE "$urls2hashes{$storePaths2urls{$storePath}}\n";
+foreach my $storePath (keys %narFiles) {
+    my $narFileList = $narFiles{$storePath};
+    foreach my $narFile (@{$narFileList}) {
+        print WRITE "$storePath\n";
+        print WRITE "$storeExpr\n";
+        print WRITE "/fetch\n";
+        print WRITE "2\n";
+        print WRITE "$narFile->{url}\n";
+        print WRITE "$narFile->{hash}\n";
+    }
 }
 
 close WRITE;