about summary refs log tree commit diff
path: root/scripts/nix-pull.in
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-10-10T21·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-10-10T21·11+0000
commit6fcdbcac202e40e5de7147ff64b34d6aaad16249 (patch)
tree3a18b2cde295fd1551bedb279948660dccd22d60 /scripts/nix-pull.in
parent659c427caa39e44e5861ff1345425e4c34c9ced3 (diff)
* Install NixManifest.pm, NixConfig.pm and GeneratePatches.pm under
  the Nix:: namespace.

Diffstat (limited to 'scripts/nix-pull.in')
-rw-r--r--scripts/nix-pull.in18
1 files changed, 9 insertions, 9 deletions
diff --git a/scripts/nix-pull.in b/scripts/nix-pull.in
index 51c7e681a5..8fb256179c 100644
--- a/scripts/nix-pull.in
+++ b/scripts/nix-pull.in
@@ -1,17 +1,17 @@
-#! @perl@ -w -I@libexecdir@/nix @perlFlags@
+#! @perl@ -w @perlFlags@
 
 use strict;
 use File::Temp qw(tempdir);
-use NixManifest;
+use Nix::Config;
+use Nix::Manifest;
 
 my $tmpDir = tempdir("nix-pull.XXXXXX", CLEANUP => 1, TMPDIR => 1)
     or die "cannot create a temporary directory";
 
-my $binDir = $ENV{"NIX_BIN_DIR"} || "@bindir@";
 my $libexecDir = ($ENV{"NIX_LIBEXEC_DIR"} or "@libexecdir@");
 my $storeDir = ($ENV{"NIX_STORE_DIR"} or "@storedir@");
 my $stateDir = ($ENV{"NIX_STATE_DIR"} or "@localstatedir@/nix");
-my $manifestDir = ($ENV{"NIX_MANIFESTS_DIR"} or "$stateDir/manifests");
+my $manifestDir = $Nix::Config::manifestDir;
 
 
 # Prevent access problems in shared-stored installations.
@@ -42,7 +42,7 @@ sub downloadFile {
     my $url = shift;
     $ENV{"PRINT_PATH"} = 1;
     $ENV{"QUIET"} = 1;
-    my ($dummy, $path) = `$binDir/nix-prefetch-url '$url'`;
+    my ($dummy, $path) = `$Nix::Config::binDir/nix-prefetch-url '$url'`;
     die "cannot fetch `$url'" if $? != 0;
     die "nix-prefetch-url did not return a path" unless defined $path;
     chomp $path;
@@ -57,16 +57,16 @@ sub processURL {
     my $manifest;
 
     # First see if a bzipped manifest is available.
-    if (system("@curl@ --fail --silent --head '$url'.bz2 > /dev/null") == 0) {
+    if (system("$Nix::Config::curl --fail --silent --head '$url'.bz2 > /dev/null") == 0) {
         print "fetching list of Nix archives at `$url.bz2'...\n";
         my $bzipped = downloadFile "$url.bz2";
 
         $manifest = "$tmpDir/MANIFEST";
 
-        system("@bunzip2@ < $bzipped > $manifest") == 0
+        system("$Nix::Config::bzip2 -d < $bzipped > $manifest") == 0
             or die "cannot decompress manifest";
 
-        $manifest = (`$binDir/nix-store --add $manifest`
+        $manifest = (`$Nix::Config::binDir/nix-store --add $manifest`
                      or die "cannot copy $manifest to the store");
         chomp $manifest;
     }
@@ -96,7 +96,7 @@ sub processURL {
         $baseName = $1;
     }
 
-    my $hash = `$binDir/nix-hash --flat '$manifest'`
+    my $hash = `$Nix::Config::binDir/nix-hash --flat '$manifest'`
         or die "cannot hash `$manifest'";
     chomp $hash;