]> git.ipfire.org Git - thirdparty/dracut.git/commitdiff
revert(10i18n): stop leaking shell options
authorPavel Valena <pvalena@redhat.com>
Fri, 25 Mar 2022 16:00:53 +0000 (17:00 +0100)
committerJóhann B. Guðmundsson <johannbg@gmail.com>
Mon, 4 Apr 2022 08:00:10 +0000 (08:00 +0000)
This reverts commit 35064768ebf14d3ec6bf3f7df52580fb4920ea3d, to replace
the implementation.

modules.d/10i18n/module-setup.sh

index 91c189e82520ca7db94af96d85d62a586ad3fc5a..f25026fb803eef9f3d4919a8c08db10e124c3842 100755 (executable)
@@ -30,7 +30,11 @@ install() {
     I18N_CONF="/etc/locale.conf"
     VCONFIG_CONF="/etc/vconsole.conf"
 
-    _findkeymap() {
+    findkeymap() {
+        # shellcheck disable=SC2064
+        trap "$(shopt -p nullglob globstar)" RETURN
+        shopt -q -s nullglob globstar
+
         local -a MAPS
         local MAPNAME
         local INCLUDES
@@ -62,21 +66,12 @@ install() {
             for INCL in "${INCLUDES[@]}"; do
                 for FN in "$dracutsysrootdir""${kbddir}"/keymaps/**/"$INCL"*; do
                     [[ -f $FN ]] || continue
-                    [[ -v KEYMAPS["$FN"] ]] || _findkeymap "$FN"
+                    [[ -v KEYMAPS["$FN"] ]] || findkeymap "$FN"
                 done
             done
         done
     }
 
-    # Wrapper around the recursive _findkeymap making sure the shell
-    # options are restored correctly
-    findkeymap() {
-        # shellcheck disable=SC2064
-        trap "$(shopt -p nullglob globstar)" RETURN
-        shopt -q -s nullglob globstar
-        _findkeymap "$@"
-    }
-
     # Function gathers variables from distributed files among the tree, maps to
     # specified names and prints the result in format "new-name=value".
     #