public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/eselect:master commit in: bin/, /
Date: Mon,  5 Jun 2023 18:34:11 +0000 (UTC)	[thread overview]
Message-ID: <1685987222.58e82125a8adfa89585468f3e6609f46896d313a.ulm@gentoo> (raw)

commit:     58e82125a8adfa89585468f3e6609f46896d313a
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Mon Jun  5 17:47:02 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Mon Jun  5 17:47:02 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=58e82125

Quote argument of ":" command

* bin/eselect.in (EPREFIX): Quote argument of ":" command.
This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223
Add some more quotes throughout.

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog      | 6 ++++++
 bin/eselect.in | 6 +++---
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index afa6885..701fb9c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2023-06-05  Ulrich Müller  <ulm@gentoo.org>
+
+	* bin/eselect.in (EPREFIX): Quote argument of ":" command.
+	This avoids globbing, see: https://www.shellcheck.net/wiki/SC2223
+	Add some more quotes throughout.
+
 2023-06-04  Ulrich Müller  <ulm@gentoo.org>
 
 	* doc/developer-guide.txt: Add subsection about module testing.

diff --git a/bin/eselect.in b/bin/eselect.in
index 9109627..c59a09d 100755
--- a/bin/eselect.in
+++ b/bin/eselect.in
@@ -45,7 +45,7 @@ ESELECT_KILL_TARGET="$$"
 # prefix for the build host. EPREFIX defaults to the same, but can be
 # overridden at runtime when building for a different prefix.
 BROOT="@EPREFIX@"
-: ${EPREFIX="${BROOT}"}
+: "${EPREFIX="${BROOT}"}"
 EROOT="${ROOT%${EPREFIX:+/}}${EPREFIX}"
 
 # Remove all alias definitions. Unset functions and variables that are
@@ -126,7 +126,7 @@ unset suffix
 if [[ -z ${action} ]]; then
 	binname=$(basename "$0")
 	for prefix in config update{,r} manage 'read'; do
-		if [[ ${binname##${prefix}-} != ${binname} ]]; then
+		if [[ ${binname##${prefix}-} != "${binname}" ]]; then
 			action=$(basename "$0")
 			action=${action##${prefix}-}
 			break
@@ -145,7 +145,7 @@ while [[ ${1##--} != "$1" ]]; do
 		colour=*|color=*|colour|color)
 			# accept all arguments that are valid for ls or emerge
 			case ${1#*=} in
-				yes|y|always|force|$1) colour=yes ;;
+				yes|y|always|force|"$1") colour=yes ;;
 				no|n|never|none) colour=no ;;
 				auto|tty|if-tty) colour="" ;;
 				*) die -q "Invalid argument for ${1%%=*} option" ;;


             reply	other threads:[~2023-06-05 18:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 18:34 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-07-08  6:20 [gentoo-commits] proj/eselect:master commit in: bin/, / Ulrich Müller
2023-06-07  8:50 Ulrich Müller
2023-06-07  7:29 Ulrich Müller
2023-03-20 17:11 Ulrich Müller
2023-02-28 18:08 Ulrich Müller
2023-02-27 17:40 Ulrich Müller
2023-02-27  7:28 Ulrich Müller
2022-01-08 20:53 Ulrich Müller
2016-01-27 19:35 Ulrich Müller

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=1685987222.58e82125a8adfa89585468f3e6609f46896d313a.ulm@gentoo \
    --to=ulm@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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