about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-12T14·41-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-09-12T14·41-0400
commit6762424e2471e3e4f9ba9b6bb883d08911d352fb (patch)
tree42bd0be71b75c73b2520e85b9dcc1742bee8d938
parentd4c3b6327ff88273462cec57b0e2805d333c386e (diff)
Compatibility fix for WWW::Curl < 4.14
Older versions of WWW::Curl don't support scalar references for
CURLOPT_WRITEDATA directly.

http://hydra.nixos.org/build/3017188
-rw-r--r--scripts/download-from-binary-cache.pl.in3
1 files changed, 2 insertions, 1 deletions
diff --git a/scripts/download-from-binary-cache.pl.in b/scripts/download-from-binary-cache.pl.in
index 335d7d9706fd..f16434d0a391 100644
--- a/scripts/download-from-binary-cache.pl.in
+++ b/scripts/download-from-binary-cache.pl.in
@@ -40,7 +40,8 @@ sub addRequest {
 
     $curl->setopt(CURLOPT_PRIVATE, $curlId);
     $curl->setopt(CURLOPT_URL, $url);
-    $curl->setopt(CURLOPT_WRITEDATA, \$requests{$curlId}->{content});
+    open (my $fh, ">", \$requests{$curlId}->{content});
+    $curl->setopt(CURLOPT_WRITEDATA, $fh);
     $curl->setopt(CURLOPT_FOLLOWLOCATION, 1);
     $curl->setopt(CURLOPT_CAINFO, $caBundle) if defined $caBundle;
     $curl->setopt(CURLOPT_USERAGENT, "Nix/$Nix::Config::version");