Skip to content

Commit

Permalink
revert(10i18n): stop leaking shell options
Browse files Browse the repository at this point in the history
This reverts commit 3506476, to replace
the implementation.
  • Loading branch information
pvalena authored and johannbg committed Apr 4, 2022
1 parent c7b3ac2 commit f63faaa
Showing 1 changed file with 6 additions and 11 deletions.
17 changes: 6 additions & 11 deletions modules.d/10i18n/module-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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".
#
Expand Down

0 comments on commit f63faaa

Please sign in to comment.