summary refs log tree commit diff
path: root/scripts
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2007-08-09 23:52:53 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2007-08-09 23:52:53 +0000
commitc5e934dcc9f3c0e75cd14fd7dbab6048abf907d1 (patch)
treebfa034347383ad6308372da8be4aa3799fa06683 /scripts
parentf881f7a017059fb501668aa85d41e873fe8f5285 (diff)
downloadguix-c5e934dcc9f3c0e75cd14fd7dbab6048abf907d1.tar.gz
* nix-pull: using nix-prefetch-url (so that we get caching for free),
  and store the manifests in the Nix store.  (So now
  /nix/var/nix/manifests/ just contains symlinks to the store and is
  searched for GC roots.)

Diffstat (limited to 'scripts')
-rw-r--r--scripts/nix-pull.in17
1 files changed, 9 insertions, 8 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 94ac744258..1a5338af20 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -7,7 +7,7 @@ use readmanifest;
 my $tmpDir = tempdir("nix-pull.XXXXXX", CLEANUP => 1, TMPDIR => 1)
     or die "cannot create a temporary directory";
 
-my $manifest = "$tmpDir/manifest";
+#my $manifest = "$tmpDir/manifest";
 
 my $binDir = $ENV{"NIX_BIN_DIR"};
 $binDir = "@bindir@" unless defined $binDir;
@@ -37,12 +37,13 @@ sub processURL {
     my $url = shift;
 
     $url =~ s/\/$//;
-    print "obtaining list of Nix archives at $url...\n";
-
-    system("@curl@ --fail -# --show-error --location --max-redirs 20 " .
-           "'$url' > '$manifest'") == 0
-           or die "curl failed: $?";
+    print "obtaining list of Nix archives at `$url'...\n";
 
+    $ENV{"PRINT_PATH"} = 1;
+    $ENV{"QUIET"} = 1;
+    my ($dummy, $manifest) = `@bindir@/nix-prefetch-url '$url'`;
+    chomp $manifest;
+    
     if (readManifest($manifest, \%narFiles, \%localPaths, \%patches) < 3) {
         die "manifest `$url' is too old (i.e., for Nix <= 0.7)\n";
     }
@@ -67,8 +68,8 @@ sub processURL {
     
     my $finalPath = "$stateDir/manifests/$baseName-$hash.nixmanifest";
     
-    system ("@coreutils@/mv", "-f", "$manifest", "$finalPath") == 0
-        or die "cannot move `$manifest' to `$finalPath";
+    system ("@coreutils@/ln", "-sfn", "$manifest", "$finalPath") == 0
+        or die "cannot link `$finalPath to `$manifest'";
 }
 
 while (@ARGV) {