hooks/do-extract/00-distfiles: supports rpm extraction via rpmextract.

This commit is contained in:
Juan RP 2014-05-08 18:44:54 +02:00
parent 17f15ae108
commit 65bf4d6fca

View file

@ -50,6 +50,7 @@ hook() {
*.bz2) cursufx="bz2";;
*.tar) cursufx="tar";;
*.zip) cursufx="zip";;
*.rpm) cursufx="rpm";;
*) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";;
esac
@ -81,7 +82,7 @@ hook() {
fi
;;
zip)
if command -v unzip 2>&1 >/dev/null; then
if command -v unzip &>/dev/null; then
unzip -q $srcdir/$curfile -d $extractdir
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
@ -90,6 +91,17 @@ hook() {
msg_error "$pkgver: cannot find unzip bin for extraction.\n"
fi
;;
rpm)
if command -v rpmextract &>/dev/null; then
cd $extractdir
rpmextract $srcdir/$curfile
if [ $? -ne 0 ]; then
msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
fi
else
msg_error "$pkgver: cannot find rpmextract for extraction.\n"
fi
;;
*)
msg_error "$pkgver: cannot guess $curfile extract suffix. ($cursufx)\n"
;;