Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] do-extract: use bsdtar for rpm and deb
@ 2022-11-09 12:46 sgn
  2022-11-10  8:17 ` classabbyamp
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: sgn @ 2022-11-09 12:46 UTC (permalink / raw)
  To: ml

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

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

https://github.com/sgn/void-packages do-extract-bsdtar-more
https://github.com/void-linux/void-packages/pull/40411

do-extract: use bsdtar for rpm and deb
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-do-extract-bsdtar-more-40411.patch --]
[-- Type: text/x-diff, Size: 6822 bytes --]

From 439ee1e44f661de6df79ea82553e7eea92566be7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 9 Nov 2022 19:36:30 +0700
Subject: [PATCH 1/4] do-extract: extract rpm with bsdtar, too

---
 common/hooks/do-extract/00-distfiles.sh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index c173fe2af1ea..9147811f95ef 100644
--- a/common/hooks/do-extract/00-distfiles.sh
+++ b/common/hooks/do-extract/00-distfiles.sh
@@ -110,14 +110,12 @@ hook() {
 			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"
+			if ! command -v bsdtar &>/dev/null; then
+				msg_error "$pkgver: cannot find bsdtar for extraction.\n"
+			fi
+			bsdtar -x --no-same-permissions --no-same-owner -f $srcdir/$curfile -C "$extractdir"
+			if [ $? -ne 0 ]; then
+				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
 			fi
 			;;
 		txt)

From 2819763bb26707e11e09c7954ce9b1fb8b459f92 Mon Sep 17 00:00:00 2001
From: classabbyamp <void@placeviolette.net>
Date: Tue, 8 Nov 2022 22:36:31 -0500
Subject: [PATCH 2/4] 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 9147811f95ef..1749bfb08ecc 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
@@ -118,6 +119,23 @@ hook() {
 				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\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"
 			;;

From ee38344dde34215725af8ca9c94cefd08ac318ae Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 9 Nov 2022 18:11:09 +0700
Subject: [PATCH 3/4] fixup! common/hooks/do-extract/00-distfiles.sh: support
 deb files

---
 common/hooks/do-extract/00-distfiles.sh | 34 +++++++++++++++----------
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index 1749bfb08ecc..583a2869b8e5 100644
--- a/common/hooks/do-extract/00-distfiles.sh
+++ b/common/hooks/do-extract/00-distfiles.sh
@@ -120,21 +120,27 @@ hook() {
 			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"
+			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
+			(
+				cd "$extractdir"
+				if innerfile="$(ar t $srcdir/$curfile | grep '^data\.tar')"; then
+					msg_error "$pkgver: unable to find data archive inside $curfile.\n"
+				fi
+				if ! ar x "$srcdir/$curfile" "$innerfile"; then
+					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
+				fi
+				if ! $TAR_CMD -x --no-same-permissions --no-same-owner -f "${innerfile}"; then
+					msg_error "$pkgver: extracting $innerfile from $curfile into $XBPS_BUILDDIR.\n"
+				fi
+				rm "${innerfile}"
+			)
 			fi
-			rm "${innerfile}"
 			;;
 		txt)
 			cp -f $srcdir/$curfile "$extractdir"

From 96fa2d771d30ce0612c4c89981dc81c1812a9e41 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 9 Nov 2022 19:37:24 +0700
Subject: [PATCH 4/4] fixup! common/hooks/do-extract/00-distfiles.sh: support
 deb files

---
 common/hooks/do-extract/00-distfiles.sh | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index 583a2869b8e5..14503de3ed76 100644
--- a/common/hooks/do-extract/00-distfiles.sh
+++ b/common/hooks/do-extract/00-distfiles.sh
@@ -127,19 +127,7 @@ hook() {
 					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
 				fi
 			else
-			(
-				cd "$extractdir"
-				if innerfile="$(ar t $srcdir/$curfile | grep '^data\.tar')"; then
-					msg_error "$pkgver: unable to find data archive inside $curfile.\n"
-				fi
-				if ! ar x "$srcdir/$curfile" "$innerfile"; then
-					msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
-				fi
-				if ! $TAR_CMD -x --no-same-permissions --no-same-owner -f "${innerfile}"; then
-					msg_error "$pkgver: extracting $innerfile from $curfile into $XBPS_BUILDDIR.\n"
-				fi
-				rm "${innerfile}"
-			)
+				msg_error "$pkgver: cannot find bsdtar for extraction.\n"
 			fi
 			;;
 		txt)

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

* Re: do-extract: use bsdtar for rpm and deb
  2022-11-09 12:46 [PR PATCH] do-extract: use bsdtar for rpm and deb sgn
@ 2022-11-10  8:17 ` classabbyamp
  2022-11-30 16:19 ` [PR PATCH] [Updated] " sgn
  2022-11-30 16:20 ` [PR PATCH] [Merged]: " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: classabbyamp @ 2022-11-10  8:17 UTC (permalink / raw)
  To: ml

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

New comment by classabbyamp on void-packages repository

https://github.com/void-linux/void-packages/pull/40411#issuecomment-1309926043

Comment:
I've incorporated the simplifications to the deb parts to my pr

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

* Re: [PR PATCH] [Updated] do-extract: use bsdtar for rpm and deb
  2022-11-09 12:46 [PR PATCH] do-extract: use bsdtar for rpm and deb sgn
  2022-11-10  8:17 ` classabbyamp
@ 2022-11-30 16:19 ` sgn
  2022-11-30 16:20 ` [PR PATCH] [Merged]: " sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2022-11-30 16:19 UTC (permalink / raw)
  To: ml

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

There is an updated pull request by sgn against master on the void-packages repository

https://github.com/sgn/void-packages do-extract-bsdtar-more
https://github.com/void-linux/void-packages/pull/40411

do-extract: use bsdtar for rpm and deb
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-do-extract-bsdtar-more-40411.patch --]
[-- Type: text/x-diff, Size: 1257 bytes --]

From 8ffba00d9157e99cad2685db420e1dce38c51794 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?=
 <congdanhqx@gmail.com>
Date: Wed, 9 Nov 2022 19:36:30 +0700
Subject: [PATCH] do-extract: extract rpm with bsdtar, too

---
 common/hooks/do-extract/00-distfiles.sh | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/common/hooks/do-extract/00-distfiles.sh b/common/hooks/do-extract/00-distfiles.sh
index b3f3b90b7b80..14503de3ed76 100644
--- a/common/hooks/do-extract/00-distfiles.sh
+++ b/common/hooks/do-extract/00-distfiles.sh
@@ -111,14 +111,12 @@ hook() {
 			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"
+			if ! command -v bsdtar &>/dev/null; then
+				msg_error "$pkgver: cannot find bsdtar for extraction.\n"
+			fi
+			bsdtar -x --no-same-permissions --no-same-owner -f $srcdir/$curfile -C "$extractdir"
+			if [ $? -ne 0 ]; then
+				msg_error "$pkgver: extracting $curfile into $XBPS_BUILDDIR.\n"
 			fi
 			;;
 		deb)

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

* Re: [PR PATCH] [Merged]: do-extract: use bsdtar for rpm and deb
  2022-11-09 12:46 [PR PATCH] do-extract: use bsdtar for rpm and deb sgn
  2022-11-10  8:17 ` classabbyamp
  2022-11-30 16:19 ` [PR PATCH] [Updated] " sgn
@ 2022-11-30 16:20 ` sgn
  2 siblings, 0 replies; 4+ messages in thread
From: sgn @ 2022-11-30 16:20 UTC (permalink / raw)
  To: ml

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

There's a merged pull request on the void-packages repository

do-extract: use bsdtar for rpm and deb
https://github.com/void-linux/void-packages/pull/40411

Description:
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


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

end of thread, other threads:[~2022-11-30 16:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-09 12:46 [PR PATCH] do-extract: use bsdtar for rpm and deb sgn
2022-11-10  8:17 ` classabbyamp
2022-11-30 16:19 ` [PR PATCH] [Updated] " sgn
2022-11-30 16:20 ` [PR PATCH] [Merged]: " sgn

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).