Github messages for voidlinux
 help / color / mirror / Atom feed
From: heindsight <heindsight@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] xbps-src: Don't unset IFS
Date: Thu, 08 Feb 2024 20:17:33 +0100	[thread overview]
Message-ID: <20240208191733.11CEB231F4@inbox.vuxu.org> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-48402@inbox.vuxu.org>

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

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

https://github.com/heindsight/void-packages xbps-src-ifs
https://github.com/void-linux/void-packages/pull/48402

xbps-src: Don't unset IFS
If IFS is unset, the shell behaves as if it has the default value of `<space><tab><newline>`. However, after unsetting IFS, constructs like
```
OFS="$IFS"; IFS=','
...
IFS="$OIFS"
```
(for example in [common/xbps-src/shutils/common.sh lines 246-253](https://github.com/void-linux/void-packages/blob/d2fbe47cac44061f1154db62f6f939178f204d15/common/xbps-src/shutils/common.sh#L246)) have the effect of setting IFS with an empty value, which breaks word-splitting. This results in an error like
```
./common/xbps-src/shutils/bulk.sh: line 125: sudo /bin/sh -c: No such file or directory
```
when running `./xbps-src update-sys` with `XBPS_SUCMD` set to the default value (`sudo /bin/sh -c`).

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

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

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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-xbps-src-ifs-48402.patch --]
[-- Type: text/x-diff, Size: 1471 bytes --]

From 1197cd24344c9830fe88ad367e542bdf056ef6a6 Mon Sep 17 00:00:00 2001
From: Heinrich Kruger <heindsight@kruger.dev>
Date: Sun, 28 Jan 2024 14:07:36 +0000
Subject: [PATCH] xbps-src: Don't unset IFS

If IFS is unset, the shell behaves as if it has the default value of
`<space><tab><newline>`. However, after unsetting IFS, constructs like
```
OFS="$IFS"; IFS=','
...
IFS="$OIFS"
```
(for example in common/xbps-src/shutils/common.sh lines 246-253) have
the effect of setting IFS with an empty value, which breaks
word-splitting. This results in an error like
```
./common/xbps-src/shutils/bulk.sh: line 125: sudo /bin/sh -c: No such file or directory
```
when running `./xbps-src update-sys` with `XBPS_SUCMD` set to the
default value (`sudo /bin/sh -c`).
---
 common/environment/setup/sourcepkg.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/environment/setup/sourcepkg.sh b/common/environment/setup/sourcepkg.sh
index b08379acdd35f..ded61bddc08b6 100644
--- a/common/environment/setup/sourcepkg.sh
+++ b/common/environment/setup/sourcepkg.sh
@@ -20,7 +20,7 @@ for var in $(awk 'BEGIN{for (i in ENVIRON) {print i}}' </dev/null); do
 		;;
 	FREEDESKTOP_SITE | KDE_SITE | VIDEOLAN_SITE | UBUNTU_SITE)
 		;;
-	_ | PWD | SHLVL | USER | PATH | SHELL | HOME | LC_COLLATE | LANG | TERM | PS1)
+	_ | PWD | SHLVL | USER | PATH | SHELL | HOME | LC_COLLATE | LANG | TERM | PS1 | IFS)
 		# known variables for shell
 		;;
 	DISTCC_HOSTS | DISTCC_DIR)

  reply	other threads:[~2024-02-08 19:17 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-28 14:29 [PR PATCH] " heindsight
2024-02-08 19:17 ` heindsight [this message]
2024-05-09  1:46 ` github-actions
2024-05-24  1:46 ` [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=20240208191733.11CEB231F4@inbox.vuxu.org \
    --to=heindsight@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).