Github messages for voidlinux
 help / color / mirror / Atom feed
From: sgn <sgn@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: [PR PATCH] xbps-src: common: wrap which and tar
Date: Sun, 03 Apr 2022 13:13:22 +0200	[thread overview]
Message-ID: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-36498@inbox.vuxu.org> (raw)

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

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

https://github.com/sgn/void-packages wrap-which-and-tar
https://github.com/void-linux/void-packages/pull/36498

xbps-src: common: wrap which and tar
<!-- Uncomment relevant sections and delete options which are not applicable -->

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

<!--
#### New package
- This new package conforms to the [quality requirements](https://github.com/void-linux/void-packages/blob/master/Manual.md#quality-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/36498.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-wrap-which-and-tar-36498.patch --]
[-- Type: text/x-diff, Size: 2919 bytes --]

From e6a3df70ad46113b75ee6610fc3d6ad5461e6e80 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: Sun, 3 Apr 2022 18:08:47 +0700
Subject: [PATCH 1/3] hooks: also wrap scripts in pre-check

---
 common/hooks/pre-check/02-script-wrapper.sh | 1 +
 1 file changed, 1 insertion(+)
 create mode 120000 common/hooks/pre-check/02-script-wrapper.sh

diff --git a/common/hooks/pre-check/02-script-wrapper.sh b/common/hooks/pre-check/02-script-wrapper.sh
new file mode 120000
index 000000000000..b637ffb30df8
--- /dev/null
+++ b/common/hooks/pre-check/02-script-wrapper.sh
@@ -0,0 +1 @@
+../pre-configure/02-script-wrapper.sh
\ No newline at end of file

From 94c9113cf882b64cc4153543e5b3ef3f9f8740c4 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: Sun, 3 Apr 2022 18:09:59 +0700
Subject: [PATCH 2/3] script-wrappers: provide naive implementation of which

---
 .../hooks/pre-configure/02-script-wrapper.sh   | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh
index 09c796001ea3..3eb7c645db1d 100644
--- a/common/hooks/pre-configure/02-script-wrapper.sh
+++ b/common/hooks/pre-configure/02-script-wrapper.sh
@@ -154,6 +154,23 @@ install_wrappers() {
 	done
 }
 
+install_which() {
+	if ! command -v which >/dev/null 2>&1; then
+		cat >>"${XBPS_WRAPPERDIR}/which" <<-'_EOF'
+		#!/bin/sh
+		ret=0
+		while test $# != 0; do
+		    case "$1" in
+		    -*) ;;
+		    *) command -v "$1" || ret=1 ;;
+		    esac
+		    shift
+		done
+		exit "$ret"
+		_EOF
+	fi
+}
+
 install_cross_wrappers() {
 	local fname prefix
 
@@ -188,6 +205,7 @@ hook() {
 	export PATH="$XBPS_WRAPPERDIR:$PATH"
 
 	install_wrappers
+	install_which
 
 	[ -z "$CROSS_BUILD" ] && return 0
 

From 6d2cca7d2e08e397c6ef9662e8cec96ee74ef088 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: Sun, 3 Apr 2022 18:11:16 +0700
Subject: [PATCH 3/3] script-wrapper: use bsdtar as tar if tar isn't provided

---
 common/hooks/pre-configure/02-script-wrapper.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh
index 3eb7c645db1d..a9767e5fa07d 100644
--- a/common/hooks/pre-configure/02-script-wrapper.sh
+++ b/common/hooks/pre-configure/02-script-wrapper.sh
@@ -171,6 +171,15 @@ install_which() {
 	fi
 }
 
+install_tar() {
+	if ! command -v tar >/dev/null 2>&1; then
+		cat >>"${XBPS_WRAPPERDIR}/tar" <<-'_EOF'
+		#!/bin/sh
+		bsdtar "$@"
+		_EOF
+	fi
+}
+
 install_cross_wrappers() {
 	local fname prefix
 
@@ -206,6 +215,7 @@ hook() {
 
 	install_wrappers
 	install_which
+	install_tar
 
 	[ -z "$CROSS_BUILD" ] && return 0
 

             reply	other threads:[~2022-04-03 11:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-03 11:13 sgn [this message]
2022-04-03 15:48 ` leahneukirchen
2022-04-07 16:24 ` Piraty
2022-07-07  2:14 ` github-actions
2022-07-21  2:14 ` [PR PATCH] [Closed]: " github-actions

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-36498@inbox.vuxu.org \
    --to=sgn@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).