10i18n: Load all keymaps for a given locale

Previously, dracut would only copy the first one found. However,
with legacy maps for some locales around, there is a chance we
pick the wrong one. Pick all matching keymaps instead

Reference: boo#1065058
master
Daniel Molkentin 2017-10-26 14:59:34 +02:00
parent d976e19325
commit 28aea41829
1 changed files with 19 additions and 14 deletions

View File

@ -29,21 +29,24 @@ install() {


# This is from 10redhat-i18n. # This is from 10redhat-i18n.
findkeymap () { findkeymap () {
local MAP=$1 local MAPS=$1
local MAPNAME=${1%.map*} local MAPNAME=${1%.map*}
[[ ! -f $MAP ]] && \ local map
MAP=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\* | head -n1) [[ ! -f $MAPS ]] && \
[[ " $KEYMAPS " = *" $MAP "* ]] && return MAPS=$(find ${kbddir}/keymaps -type f -name ${MAPNAME} -o -name ${MAPNAME}.map -o -name ${MAPNAME}.map.\*)
KEYMAPS="$KEYMAPS $MAP"
case $MAP in
*.gz) cmd=zgrep;;
*.bz2) cmd=bzgrep;;
*) cmd=grep ;;
esac


for INCL in $($cmd "^include " $MAP | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do for map in $MAPS; do
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do KEYMAPS="$KEYMAPS $map"
findkeymap $FN case $map in
*.gz) cmd=zgrep;;
*.bz2) cmd=bzgrep;;
*) cmd=grep ;;
esac

for INCL in $($cmd "^include " $map | while read a a b || [ -n "$a" ]; do echo ${a//\"/}; done); do
for FN in $(find ${kbddir}/keymaps -type f -name $INCL\*); do
findkeymap $FN
done
done done
done done
} }
@ -191,7 +194,9 @@ install() {
findkeymap ${map} findkeymap ${map}
done done


inst_opt_decompress ${KEYMAPS} for keymap in ${KEYMAPS}; do
inst_opt_decompress ${keymap}
done


inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.* inst_opt_decompress ${kbddir}/consolefonts/${DEFAULT_FONT}.*