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: libs/, /
Date: Wed,  1 Jun 2016 19:43:15 +0000 (UTC)	[thread overview]
Message-ID: <1464810071.da9a451824ccd5e4e2b9be405fecad82599ba702.ulm@gentoo> (raw)

commit:     da9a451824ccd5e4e2b9be405fecad82599ba702
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Wed Jun  1 19:41:11 2016 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Wed Jun  1 19:41:11 2016 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=da9a4518

Avoid absolute paths for programs.

* configure.ac: Where possible, use AC_CHECK_PROGS instead of
AC_PATH_PROGS, in order to avoid absolute paths, bug 122260.
* libs/core.bash.in (sed):
* libs/package-manager.bash.in (portageq): Invoke commands with
"command" so that they will work without a path.

 ChangeLog                    |  8 ++++++++
 configure.ac                 | 31 +++++++++++++------------------
 libs/core.bash.in            |  4 ++--
 libs/package-manager.bash.in |  4 ++--
 4 files changed, 25 insertions(+), 22 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 5bb2855..c166ad0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-06-01  Ulrich Müller  <ulm@gentoo.org>
+
+	* configure.ac: Where possible, use AC_CHECK_PROGS instead of
+	AC_PATH_PROGS, in order to avoid absolute paths, bug 122260.
+	* libs/core.bash.in (sed):
+	* libs/package-manager.bash.in (portageq): Invoke commands with
+	"command" so that they will work without a path.
+
 2016-01-27  Ulrich Müller  <ulm@gentoo.org>
 
 	* bin/eselect.in: Set umask +rx, bug 572348.

diff --git a/configure.ac b/configure.ac
index 8f38759..6fce662 100644
--- a/configure.ac
+++ b/configure.ac
@@ -19,7 +19,7 @@ fi
 
 # AC_PROG_SED doesn't work here, because on Gentoo FreeBSD systems it
 # is confused by a wrapper script that is in the PATH at build time.
-AC_PATH_PROGS(SED, [gsed sed])
+AC_CHECK_PROGS(SED, [gsed sed])
 if test x$SED = x; then
     AC_MSG_ERROR([sed is required])
 fi
@@ -31,27 +31,22 @@ else
     AC_MSG_ERROR([GNU sed is required])
 fi
 
-AC_PATH_PROG(PORTAGEQ, portageq, /usr/bin/portageq,
-  [$prefix/bin:/usr/bin:/bin:$PATH])
 AC_PATH_PROG(ENV_UPDATE, env-update, /usr/sbin/env-update,
   [$PATH:$prefix/sbin:/usr/sbin])
 
-AC_PATH_PROG(READLINK, greadlink)
-if test x$READLINK = x; then
-    AC_PATH_PROG(READLINK, readlink)
-    if test x$READLINK != x; then
-        AC_MSG_CHECKING([whether readlink supports -f])
-        if $READLINK -f . >/dev/null 2>&1; then
-            AC_MSG_RESULT(yes)
-        else
-            AC_MSG_RESULT(no)
-            READLINK=""
-        fi
-    fi
-    if test x$READLINK = x; then
-        AC_PATH_PROG(REALPATH, realpath)
+AC_CHECK_PROGS(READLINK, [greadlink readlink])
+if test x$READLINK != x; then
+    AC_MSG_CHECKING([whether $READLINK supports -f])
+    if $READLINK -f . >/dev/null 2>&1; then
+        AC_MSG_RESULT(yes)
+    else
+        AC_MSG_RESULT(no)
+        READLINK=""
     fi
 fi
+if test x$READLINK = x; then
+    AC_CHECK_PROGS(REALPATH, realpath)
+fi
 if test x$READLINK != x; then
     CANONICALISE="$READLINK -f"
 elif test x$REALPATH != x; then
@@ -63,7 +58,7 @@ AC_SUBST(CANONICALISE)
 
 # Gentoo uses rst2html.py but most other
 # distros install it w/o the .py extension
-AC_PATH_PROGS(RST2HTML, [rst2html rst2html.py])
+AC_CHECK_PROGS(RST2HTML, [rst2html rst2html.py])
 
 # Support for Gentoo Prefix
 AC_MSG_CHECKING([if target installation is in an offset prefix])

diff --git a/libs/core.bash.in b/libs/core.bash.in
index 6b6f049..baddfde 100644
--- a/libs/core.bash.in
+++ b/libs/core.bash.in
@@ -119,7 +119,7 @@ inherit() {
 	done
 }
 
-# GNU sed wrapper (real path to GNU sed determined by configure)
+# GNU sed wrapper (sed or gsed, as determined by configure)
 sed() {
-	@SED@ "$@"
+	command @SED@ "$@"
 }

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index 691bd3c..b6d8218 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -28,9 +28,9 @@ package_manager() {
 }
 
 # portageq
-# Run portageq with safe filename as set by configure. Redirect stderr
+# Run portageq. Redirect stderr
 portageq() {
-	@PORTAGEQ@ "$@" 2>/dev/null
+	command portageq "$@" 2>/dev/null
 }
 
 # run_paludis PRIVATE


             reply	other threads:[~2016-06-01 19:43 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-01 19:43 Ulrich Müller [this message]
  -- strict thread matches above, loose matches on Subject: below --
2023-05-12 16:44 [gentoo-commits] proj/eselect:master commit in: libs/, / Ulrich Müller
2023-03-14 16:53 Ulrich Müller
2017-12-25 11:00 Ulrich Müller
2017-06-18 19:32 Ulrich Müller
2017-03-21  6:33 Ulrich Müller
2016-12-10  8:18 Ulrich Müller
2016-11-01  6:43 Ulrich Müller
2016-10-30  9:17 Ulrich Müller
2014-03-14 19:43 Ulrich Müller
2014-01-19 16:36 Ulrich Müller
2013-11-19 12:54 Ulrich Müller
2013-11-19  8:17 Ulrich Müller
2013-11-10 20:24 Ulrich Müller
2013-06-17 15:26 Ulrich Mueller
2013-01-05 13:47 Ulrich Mueller

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=1464810071.da9a451824ccd5e4e2b9be405fecad82599ba702.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