commit:     ad863d288f29bcca776369dec7765dbb0174ba82
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Thu May 11 17:04:20 2023 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Thu May 11 17:04:20 2023 +0000
URL:        https://gitweb.gentoo.org/proj/eselect.git/commit/?id=ad863d28

Don't autodetect bash and env-update at configure time

* bin/eselect.in: Update shebang to use EPREFIX. Bug 905934.
* bin/Makefile.am (dosed): Don't substitute BASH.
* libs/package-manager.bash.in (env_update): Don't use an absolute
path for env-update.
* libs/Makefile.am (dosed): Don't substitute ENV_UPDATE.
* configure.ac: Drop checks for bash and env-update paths.

Bug: https://bugs.gentoo.org/905934
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog                    |  7 +++++++
 bin/Makefile.am              |  3 +--
 bin/eselect.in               |  2 +-
 configure.ac                 | 12 ------------
 libs/Makefile.am             |  1 -
 libs/package-manager.bash.in |  4 ++--
 6 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 0684481..ce13578 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2023-05-11  Ulrich Müller  <u...@gentoo.org>
 
+       * bin/eselect.in: Update shebang to use EPREFIX. Bug 905934.
+       * bin/Makefile.am (dosed): Don't substitute BASH.
+       * libs/package-manager.bash.in (env_update): Don't use an absolute
+       path for env-update.
+       * libs/Makefile.am (dosed): Don't substitute ENV_UPDATE.
+       * configure.ac: Drop checks for bash and env-update paths.
+
        * libs/Makefile.am (dosed): Don't substitute PORTAGEQ, it no
        longer exists in configure.
 

diff --git a/bin/Makefile.am b/bin/Makefile.am
index 20902c1..a4bf2a2 100644
--- a/bin/Makefile.am
+++ b/bin/Makefile.am
@@ -1,8 +1,7 @@
 bin_SCRIPTS = eselect
 EXTRA_DIST = eselect.in
 
-dosed = @SED@ -e 's%\@BASH\@%$(BASH)%g' \
-             -e 's%\@DATADIR\@%$(datadir)%g' \
+dosed = @SED@ -e 's%\@DATADIR\@%$(datadir)%g' \
              -e 's%\@EPREFIX\@%$(EPREFIX)%g' \
              -e 's%\@VERSION\@%$(VERSION)$(EXTRAVERSION)%g'
 

diff --git a/bin/eselect.in b/bin/eselect.in
index 7a74098..9109627 100755
--- a/bin/eselect.in
+++ b/bin/eselect.in
@@ -1,4 +1,4 @@
-#!@BASH@
+#!@EPREFIX@/bin/bash
 # -*-eselect-*-  vim: ft=eselect
 # Copyright (c) 2005-2023 Gentoo Authors
 #

diff --git a/configure.ac b/configure.ac
index e767884..3d5741b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8,15 +8,6 @@ test x$prefix = xNONE && prefix="$ac_default_prefix"
 test x$datadir = xNONE && datadir="$ac_default_datadir"
 test x$sysconfdir = xNONE && sysconfdir="$ac_default_sysconfdir"
 
-# BASH may already be set in the shell, if the admin then changes the
-# the /bin/sh symlink to a non-bash shell, all hell will break lose.
-# thanks to James Rowe for the heads up.
-unset BASH
-AC_PATH_PROGS(BASH, bash)
-if test x$BASH = x; then
-    AC_MSG_ERROR([bash is required])
-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_CHECK_PROGS(SED, [gsed sed])
@@ -31,9 +22,6 @@ else
     AC_MSG_ERROR([GNU sed is required])
 fi
 
-AC_PATH_PROG(ENV_UPDATE, env-update, /usr/sbin/env-update,
-  [$PATH:$prefix/sbin:/usr/sbin])
-
 CANONICALISE=""
 # realpath is included with Coreutils since version 8.15 (2012)
 AC_CHECK_PROGS(REALPATH, [grealpath realpath])

diff --git a/libs/Makefile.am b/libs/Makefile.am
index c5f3de3..debaa1d 100644
--- a/libs/Makefile.am
+++ b/libs/Makefile.am
@@ -28,7 +28,6 @@ EXTRA_DIST = \
 
 dosed = @SED@ \
        -e 's%\@SED\@%@SED@%g' \
-       -e 's%\@ENV_UPDATE\@%@ENV_UPDATE@%g' \
        -e 's%\@CANONICALISE\@%@CANONICALISE@%g' \
        -e 's%\@libdir\@%@libdir@%g'
 

diff --git a/libs/package-manager.bash.in b/libs/package-manager.bash.in
index c32fcb4..7688b96 100644
--- a/libs/package-manager.bash.in
+++ b/libs/package-manager.bash.in
@@ -1,5 +1,5 @@
 # -*-eselect-*-  vim: ft=eselect
-# Copyright (c) 2005-2021 Gentoo Authors
+# Copyright (c) 2005-2023 Gentoo Authors
 #
 # This file is part of the 'eselect' tools framework.
 #
@@ -209,7 +209,7 @@ env_update() {
        local noldconfig
        [[ $1 -ne 0 ]] || noldconfig=y
        case $(package_manager) in
-               portage) "@ENV_UPDATE@" ${noldconfig:+--no-ldconfig} ;;
+               portage) env-update ${noldconfig:+--no-ldconfig} ;;
                pkgcore) pmaint env-update ${noldconfig:+--skip-ldconfig} ;;
                paludis) return 127 ;;
        esac

Reply via email to