about summary refs log tree commit diff
path: root/scripts/download-from-binary-cache.pl.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-18T15·01-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-18T15·01-0400
commitaa115e22df1c80e8878237a9e704d7d70783a243 (patch)
treedded648393c728b3ed041ee5cbb4ca1febda3cdb /scripts/download-from-binary-cache.pl.in
parentfe241ece2932492866693d268d02a7912e766ac7 (diff)
download-from-binary-cache: Print correct URL
Diffstat (limited to 'scripts/download-from-binary-cache.pl.in')
-rw-r--r--scripts/download-from-binary-cache.pl.in7
1 files changed, 5 insertions, 2 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in
index 6f4b55766d..5fb0419f18 100644
--- a/scripts/download-from-binary-cache.pl.in
+++ b/scripts/download-from-binary-cache.pl.in
@@ -213,6 +213,8 @@ sub processNARInfo {
         print STDERR "bad NAR info file ‘$request->{url}’\n";
         return undef;
     }
+
+    # FIXME: validate $url etc. for security.
     
     # Cache the result.
     $insertNAR->execute(
@@ -417,8 +419,9 @@ sub downloadBinary {
             print STDERR "unknown compression method ‘$info->{compression}’\n";
             next;
         }
-        print STDERR "\n*** Downloading ‘$info->{url}’ into ‘$storePath’...\n";
-        if (system("$Nix::Config::curl --fail --location $binaryCacheUrl/$info->{url} | $decompressor | $Nix::Config::binDir/nix-store --restore $storePath") != 0) {
+        my $url = "$binaryCacheUrl/$info->{url}"; # FIXME: handle non-relative URLs
+        print STDERR "\n*** Downloading ‘$url’ into ‘$storePath’...\n";
+        if (system("$Nix::Config::curl --fail --location '$url' | $decompressor | $Nix::Config::binDir/nix-store --restore $storePath") != 0) {
             die "download of `$info->{url}' failed" . ($! ? ": $!" : "") . "\n" unless $? == 0;
             next;
         }