Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] common/hooks/do-extract/00-distfiles.sh: support deb files
@ 2022-11-09  6:08 classabbyamp
  2022-11-09 11:12 ` [PR PATCH] [Updated] " sgn
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: classabbyamp @ 2022-11-09  6:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 527 bytes --]

There is a new pull request by classabbyamp against master on the void-packages repository

https://github.com/classabbyamp/void-packages deb-extract
https://github.com/void-linux/void-packages/pull/40405

common/hooks/do-extract/00-distfiles.sh: support deb files
<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**|**briefly**|**NO**



A patch file from https://github.com/void-linux/void-packages/pull/40405.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-deb-extract-40405.patch --]
[-- Type: text/x-diff, Size: 2052 bytes --]

From 8378bbb950c224be87a4b5b7b59623d907a1ee4f Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
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 | 22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index c173fe2af1ea..309504d657c0 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,23 @@ hook() {
 				msg_error "$pkgver: cannot find rpmextract for extraction.\n"
 			fi
 			;;
+		deb)
+			cd "$extractdir"
+			innerfile="$(ar t $srcdir/$curfile | grep '^data\.tar')"
+			if [ $? -ne 0 ]; then
+				msg_error "$pkgver: unable to find data archive inside $curfile.\n"
+			fi
+			ar x "$srcdir/$curfile" "$innerfile"
+			if [ $? -ne 0 ]; then
+				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
+			fi
+			mkdir -p "${curfile%.deb}"
+			$TAR_CMD -x --no-same-permissions --no-same-owner -f "${innerfile}" -C "${curfile%.deb}"
+			if [ $? -ne 0 ]; then
+				msg_error "$pkgver: extracting $innerfile from $curfile into $XBPS_BUILDDIR.\n"
+			fi
+			rm "${innerfile}"
+			;;
 		txt)
 			cp -f $srcdir/$curfile "$extractdir"
 			;;

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-11-19  4:47 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09  6:08 [PR PATCH] common/hooks/do-extract/00-distfiles.sh: support deb files classabbyamp
2022-11-09 11:12 ` [PR PATCH] [Updated] " sgn
2022-11-10  8:14 ` classabbyamp
2022-11-10  8:37 ` classabbyamp
2022-11-10  9:21 ` classabbyamp
2022-11-10  9:23 ` classabbyamp
2022-11-10  9:34 ` classabbyamp
2022-11-11  8:03 ` classabbyamp
2022-11-11  8:04 ` classabbyamp
2022-11-11  8:16 ` [PR PATCH] [Updated] " classabbyamp
2022-11-11  9:03 ` [PR REVIEW] " sgn
2022-11-11  9:03 ` sgn
2022-11-11 11:21 ` classabbyamp
2022-11-11 11:25 ` [PR PATCH] [Updated] " classabbyamp
2022-11-17  2:42 ` classabbyamp
2022-11-19  4:19 ` [PR PATCH] [Updated] " classabbyamp
2022-11-19  4:32 ` classabbyamp
2022-11-19  4:47 ` [PR PATCH] [Merged]: " classabbyamp

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).