diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh index 19456cf0d0..92d4714ce9 100644 --- a/common/hooks/do-extract/00-distfiles.sh +++ b/common/hooks/do-extract/00-distfiles.sh @@ -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" ;;