commit:     e9652d95e71f9eda642f8a5894ea33cda62376b6
Author:     Kerin Millar <kfm <AT> plushkava <DOT> net>
AuthorDate: Wed May 28 01:43:47 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri May 30 07:30:35 2025 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=e9652d95

misc-functions.sh: avoid arbitrarily toggling nullglob

The nullglob option is being disabled by install_hooks(), regardless of
whether it was enabled prior to invoking the function. The simplest
solution is to not set nullglob. The subsequent -x test will already
fail in the case that the glob expands as it itself without "*" being
the actual name of an executable file.

Signed-off-by: Kerin Millar <kfm <AT> plushkava.net>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 bin/misc-functions.sh | 2 --
 1 file changed, 2 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 386e50cc8d..da7ff2da47 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -659,14 +659,12 @@ install_hooks() {
        local fp
        local ret=0
 
-       shopt -s nullglob
        for fp in "${hooks_dir}"/*; do
                if [[ -x "${fp}" ]]; then
                        "${fp}"
                        ret=$(( ${ret} | $? ))
                fi
        done
-       shopt -u nullglob
 
        return ${ret}
 }

Reply via email to