From bd3fe8231c96146319b919ce71c8232c797ec253 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Tue, 8 Nov 2022 22:36:31 -0500 Subject: [PATCH] common/hooks/do-extract/00-distfiles.sh: support deb files --- common/hooks/do-extract/00-distfiles.sh | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh index c173fe2af1ea..b3f3b90b7b80 100644 --- a/common/hooks/do-extract/00-distfiles.sh +++ b/common/hooks/do-extract/00-distfiles.sh @@ -3,7 +3,7 @@ hook() { local srcdir="$XBPS_SRCDISTDIR/$pkgname-$version" - local f j curfile found extractdir innerdir num_dirs + local f j curfile found extractdir innerdir innerfile num_dirs local TAR_CMD if [ -z "$distfiles" -a -z "$checksum" ]; then @@ -62,6 +62,7 @@ hook() { *.tar) cursufx="tar";; *.zip) cursufx="zip";; *.rpm) cursufx="rpm";; + *.deb) cursufx="deb";; *.patch) cursufx="txt";; *.diff) cursufx="txt";; *.txt) cursufx="txt";; @@ -84,7 +85,7 @@ hook() { cd "$extractdir" case ${cursufx} in gz) - gunzip -f $curfile + gunzip -f $curfile ;; bz2) bunzip2 -f $curfile @@ -120,6 +121,17 @@ hook() { msg_error "$pkgver: cannot find rpmextract for extraction.\n" fi ;; + deb) + if command -v bsdtar &>/dev/null; then + bsdtar -x -O -f "$srcdir/$curfile" "data.tar.*" | + bsdtar -C "$extractdir" -x --no-same-permissions --no-same-owner + if [ $? -ne 0 ]; then + msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n" + fi + else + msg_error "$pkgver: cannot find bsdtar for extraction.\n" + fi + ;; txt) cp -f $srcdir/$curfile "$extractdir" ;;