From 65bf4d6fca23e13f39be7c3b3b95f01889ec68d2 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 8 May 2014 18:44:54 +0200 Subject: [PATCH] hooks/do-extract/00-distfiles: supports rpm extraction via rpmextract. --- common/hooks/do-extract/00-distfiles.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh index 19456cf0d02..92d4714ce9b 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" ;;