From c6c249348dfd07c6870ee1c933dd0cbe2c6e3cf0 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Fri, 26 Oct 2018 16:39:18 -0300 Subject: [PATCH] hooks/do-extract: support extracting .gem files with gem unpack. --- common/hooks/do-extract/00-distfiles.sh | 7 +++++++ common/hooks/do-fetch/00-distfiles.sh | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh index a4b2669df1..c221bad929 100644 --- a/common/hooks/do-extract/00-distfiles.sh +++ b/common/hooks/do-extract/00-distfiles.sh @@ -55,6 +55,7 @@ hook() { *.diff) cursufx="txt";; *.txt) cursufx="txt";; *.7z) cursufx="7z";; + *.gem) cursufx="gem";; *) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";; esac @@ -119,6 +120,12 @@ hook() { msg_error "$pkgver: cannot find 7z bin for extraction.\n" fi ;; + gem) + tar -xOf $srcdir/$curfile data.tar.gz | tar -xz -C $extractdir --transform="s,^,$(basename $wrksrc)/," + if [ $? -ne 0 ]; then + msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n" + fi + ;; *) msg_error "$pkgver: cannot guess $curfile extract suffix. ($cursufx)\n" ;; diff --git a/common/hooks/do-fetch/00-distfiles.sh b/common/hooks/do-fetch/00-distfiles.sh index 09bac46fa6..43b9c66b62 100644 --- a/common/hooks/do-fetch/00-distfiles.sh +++ b/common/hooks/do-fetch/00-distfiles.sh @@ -43,6 +43,7 @@ contents_cksum() { *.diff) cursufx="txt";; *.txt) cursufx="txt";; *.7z) cursufx="7z";; + *.gem) cursufx="gem";; *) msg_error "$pkgver: unknown distfile suffix for $curfile.\n";; esac @@ -92,6 +93,9 @@ contents_cksum() { msg_error "$pkgver: cannot find 7z bin for extraction.\n" fi ;; + gem) + cksum=$(tar -xf "$curfile" data.tar.gz --to-stdout | tar -xzO | sha256sum | awk '{print $1}') + ;; *) msg_error "$pkgver: cannot guess $curfile extract suffix. ($cursufx)\n" ;;