hooks/do-extract/distfiles: simplify and support .tar.lz files.

This commit is contained in:
Juan RP 2014-03-14 11:04:51 +01:00
parent 74fc8c06a8
commit 14c15b0973

View file

@ -38,6 +38,8 @@ hook() {
case $curfile in case $curfile in
*.tar.lzma) cursufx="txz";; *.tar.lzma) cursufx="txz";;
*.tar.lz) cursufx="tlz";;
*.tlz) cursufx="tlz";;
*.tar.xz) cursufx="txz";; *.tar.xz) cursufx="txz";;
*.txz) cursufx="txz";; *.txz) cursufx="txz";;
*.tar.bz2) cursufx="tbz";; *.tar.bz2) cursufx="tbz";;
@ -58,20 +60,8 @@ hook() {
fi fi
case ${cursufx} in case ${cursufx} in
txz) txz|tbz|tlz|tgz)
unxz -cf $srcdir/$curfile | tar xf - -C $extractdir tar xf $srcdir/$curfile -C $extractdir
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
fi
;;
tbz)
bunzip2 -cf $srcdir/$curfile | tar xf - -C $extractdir
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
fi
;;
tgz)
gunzip -cf $srcdir/$curfile | tar xf - -C $extractdir
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n" msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
fi fi