about summary refs log tree commit diff
path: root/scripts/nix-channel.in
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-05T10·02+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-12-05T10·02+0100
commit566afa1e9c804dd4a893960f30325a38c81a4c51 (patch)
treecfba6b7fd4bab207513e1e4d20ccadf6ec2a49c8 /scripts/nix-channel.in
parent444b03a36fc038f030241d3d006d13ba2ae12e6b (diff)
Support xz compression of nixexprs.tar in channels
Diffstat (limited to 'scripts/nix-channel.in')
-rwxr-xr-xscripts/nix-channel.in4
1 files changed, 3 insertions, 1 deletions
diff --git a/scripts/nix-channel.in b/scripts/nix-channel.in
index 7b292ee8cf64..4a480ae28b04 100755
--- a/scripts/nix-channel.in
+++ b/scripts/nix-channel.in
@@ -122,7 +122,9 @@ sub update {
         }
 
         # Download the channel tarball.
-        my $fullURL = "$url/nixexprs.tar.bz2";
+        my $fullURL = "$url/nixexprs.tar.xz";
+        system("$Nix::Config::curl --fail --silent --head '$fullURL' > /dev/null") == 0 or
+            $fullURL = "$url/nixexprs.tar.bz2";
         print STDERR "downloading Nix expressions from `$fullURL'...\n";
         my ($hash, $path) = `PRINT_PATH=1 QUIET=1 $Nix::Config::binDir/nix-prefetch-url '$fullURL'`;
         die "cannot fetch `$fullURL'\n" if $? != 0;