diff options
author | Ulrich Müller <ulm@gentoo.org> | 2016-06-01 21:41:11 +0200 |
---|---|---|
committer | Ulrich Müller <ulm@gentoo.org> | 2016-06-01 21:41:11 +0200 |
commit | da9a451824ccd5e4e2b9be405fecad82599ba702 (patch) | |
tree | 318f36823533032763bc95698133f394e9ff482a | |
parent | Happy new year 2016! (diff) | |
download | eselect-da9a451824ccd5e4e2b9be405fecad82599ba702.tar.gz eselect-da9a451824ccd5e4e2b9be405fecad82599ba702.tar.bz2 eselect-da9a451824ccd5e4e2b9be405fecad82599ba702.zip |
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.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | configure.ac | 31 | ||||
-rw-r--r-- | libs/core.bash.in | 4 | ||||
-rw-r--r-- | libs/package-manager.bash.in | 4 |
4 files changed, 25 insertions, 22 deletions
@@ -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 |