mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-01-22 14:45:27 +00:00
stdenv/build-support: support .tbz and .txz tarballs
This commit is contained in:
parent
80b5f5227e
commit
bd63de114e
|
@ -836,9 +836,10 @@ passthru = {
|
|||
These can optionally be compressed using <command>gzip</command>
|
||||
(<filename>.tar.gz</filename>, <filename>.tgz</filename> or
|
||||
<filename>.tar.Z</filename>), <command>bzip2</command>
|
||||
(<filename>.tar.bz2</filename> or <filename>.tbz2</filename>) or
|
||||
<command>xz</command> (<filename>.tar.xz</filename> or
|
||||
<filename>.tar.lzma</filename>).
|
||||
(<filename>.tar.bz2</filename>, <filename>.tbz2</filename> or
|
||||
<filename>.tbz</filename>) or <command>xz</command>
|
||||
(<filename>.tar.xz</filename>, <filename>.tar.lzma</filename> or
|
||||
<filename>.txz</filename>).
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
findTarball() {
|
||||
local suffix i
|
||||
if [ -d "$1/tarballs/" ]; then
|
||||
for suffix in tar.gz tgz tar.bz2 tbz2 tar.xz tar.lzma; do
|
||||
for suffix in tar.gz tgz tar.bz2 tbz2 tbz tar.xz txz tar.lzma; do
|
||||
for i in $1/tarballs/*.$suffix; do echo $i; break; done
|
||||
done | sort | head -1
|
||||
return
|
||||
|
|
|
@ -801,11 +801,11 @@ _defaultUnpack() {
|
|||
else
|
||||
|
||||
case "$fn" in
|
||||
*.tar.xz | *.tar.lzma)
|
||||
*.tar.xz | *.tar.lzma | *.txz)
|
||||
# Don't rely on tar knowing about .xz.
|
||||
xz -d < "$fn" | tar xf -
|
||||
;;
|
||||
*.tar | *.tar.* | *.tgz | *.tbz2)
|
||||
*.tar | *.tar.* | *.tgz | *.tbz2 | *.tbz)
|
||||
# GNU tar can automatically select the decompression method
|
||||
# (info "(tar) gzip").
|
||||
tar xf "$fn"
|
||||
|
|
Loading…
Reference in a new issue