mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-14 02:06:16 +02:00
Support xz compression of nixexprs.tar in channels
This commit is contained in:
parent
444b03a36f
commit
566afa1e9c
2 changed files with 9 additions and 2 deletions
|
@ -6,7 +6,12 @@ let
|
||||||
''
|
''
|
||||||
mkdir $out
|
mkdir $out
|
||||||
cd $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
|
mv * $out/$channelName
|
||||||
if [ -n "$binaryCacheURL" ]; then
|
if [ -n "$binaryCacheURL" ]; then
|
||||||
mkdir $out/binary-caches
|
mkdir $out/binary-caches
|
||||||
|
|
|
@ -122,7 +122,9 @@ sub update {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Download the channel tarball.
|
# 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";
|
print STDERR "downloading Nix expressions from `$fullURL'...\n";
|
||||||
my ($hash, $path) = `PRINT_PATH=1 QUIET=1 $Nix::Config::binDir/nix-prefetch-url '$fullURL'`;
|
my ($hash, $path) = `PRINT_PATH=1 QUIET=1 $Nix::Config::binDir/nix-prefetch-url '$fullURL'`;
|
||||||
die "cannot fetch `$fullURL'\n" if $? != 0;
|
die "cannot fetch `$fullURL'\n" if $? != 0;
|
||||||
|
|
Loading…
Reference in a new issue