Skip to content
Snippets Groups Projects
Commit 566afa1e authored by Eelco Dolstra's avatar Eelco Dolstra
Browse files

Support xz compression of nixexprs.tar in channels

parent 444b03a3
No related branches found
No related tags found
No related merge requests found
......@@ -6,7 +6,12 @@ let
''
mkdir $out
cd $out
${bzip2} -d < $src | ${tar} xf - ${tarFlags}
pat="\.xz\$"
if [[ "$src" =~ $pat ]]; then
${xz} -d < $src | ${tar} xf - ${tarFlags}
else
${bzip2} -d < $src | ${tar} xf - ${tarFlags}
fi
mv * $out/$channelName
if [ -n "$binaryCacheURL" ]; then
mkdir $out/binary-caches
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment