Support xz compression of nixexprs.tar in channels

This commit is contained in:
Eelco Dolstra 2012-12-05 11:02:44 +01:00
parent 444b03a36f
commit 566afa1e9c
2 changed files with 9 additions and 2 deletions

View file

@ -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;