DSL Ideas and Suggestions :: Kbdconfig fixes



I stumbled upon two logical mistakes in the kbdconfig script. The first is wrong placement of the existing keymap (if booted with the lang=xx option), it's supposed to be like the other keymaps, xx-long-name short-name, but since it's the other way around, pressing enter on it might load the wrong keymap (for example you booted to fr-latin1, this would replace it with fr).
The other bug shows the "keymaps" directory in the list of keymaps when it obviously shouldn't.

Patch for both:
Quote
--- kbdconfig   2008-05-25 13:41:04.000000000 +0300
+++ kbdconfig2  2008-05-25 13:45:09.000000000 +0300
@@ -32,12 +32,12 @@
*)  TITLE="Please choose keyboard"; ;;
esac

-for i in `find /usr/share/keymaps -name \*map\*`; do
+for i in `find /usr/share/keymaps/* -name \*map\*`; do
       FILE="${i%%.*map*}"; NAME="${FILE##*/}"
       [ "$NAME" != "$KEYTABLE" ] && KEYMAPS="$KEYMAPS $NAME ${NAME%%-*}"
done

-DEFAULT="${KEYTABLE%%-*} $KEYTABLE"
+DEFAULT="$KEYTABLE ${KEYTABLE%%-*}"

dialog --clear --title "$TITLE" --menu "Default: ${KEYTABLE:-none}" 22 70 15 $DEFAULT $KEYMAPS 2>"$TMP"


Thanks! Will patch.

original here.