sm-commit AT lists.ibiblio.org
Subject: Source Mage code commit list
List archive
[[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (b850704d02d9a94d91b60aa737a4a2132571a202)
- From: Ismael Luceno <scm AT sourcemage.org>
- To: sm-commit AT lists.ibiblio.org, sm-commit AT lists.sourcemage.org
- Subject: [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (b850704d02d9a94d91b60aa737a4a2132571a202)
- Date: Mon, 9 Jun 2025 04:55:23 +0000
GIT changes to master grimoire by Ismael Luceno <ismael AT sourcemage.org>:
utils/kbd/DETAILS | 1 +
utils/kbd/HISTORY | 4 ++++
utils/kbd/init.d/keymap.sh | 32 ++++++++++----------------------
3 files changed, 15 insertions(+), 22 deletions(-)
New commits:
commit b850704d02d9a94d91b60aa737a4a2132571a202
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>
kbd: Fix and optimize keymaps.sh
Make it properly apply INCLUDEMAPS; for this the loadkeys binary needs to
be called once with the main keymap and all the includes.
Optimisations:
* Fix up INCLUDEMAPS without traversing the keymaps;
* Get TTY_NUMS (for the * case) using a single AWK script invocation;
* Use the built-in echo, no reason not to.
diff --git a/utils/kbd/DETAILS b/utils/kbd/DETAILS
index da9fcdb..568e267 100755
--- a/utils/kbd/DETAILS
+++ b/utils/kbd/DETAILS
@@ -1,5 +1,6 @@
SPELL=kbd
VERSION=2.8.0
+ PATCHLEVEL=1
SOURCE_HASH=sha512:66b532e782b6be3f53521a8d1c96f2ce895201dae48f8797c563be895dfdf4e9c03b9ccf39708d1b7dd1ffb13d526e499874e8e4ba74d22b507c1d32e4b410a3
SOURCE=$SPELL-$VERSION.tar.xz
SOURCE_DIRECTORY="$BUILD_DIRECTORY/$SPELL-$VERSION"
diff --git a/utils/kbd/HISTORY b/utils/kbd/HISTORY
index 865b24f..87b5721 100644
--- a/utils/kbd/HISTORY
+++ b/utils/kbd/HISTORY
@@ -1,3 +1,7 @@
+2025-06-09 Ismael Luceno <ismael AT sourcemage.org>
+ * DETAILS: PATCHLEVEL++
+ * init.d/keymap.sh: optimized and fixed loading of INCLUDEMAPS
+
2025-05-30 Pavel Vinogradov <public AT sourcemage.org>
* DETAILS: version 2.8.0
diff --git a/utils/kbd/init.d/keymap.sh b/utils/kbd/init.d/keymap.sh
index 6b5808f..10fa557 100755
--- a/utils/kbd/init.d/keymap.sh
+++ b/utils/kbd/init.d/keymap.sh
@@ -15,22 +15,14 @@ start()
{
[[ "$TTY_NUMS" ]] && [[ "$SETFONT_ARGS" ]] &&
required_executable /bin/setfont
- [[ "$KEYMAP$INCLUDEMAPS" ]] &&
+ if [[ "$KEYMAP$INCLUDEMAPS" ]]; then
required_executable /bin/loadkeys
-
- if [[ "$KEYMAP" ]]; then
- echo "$(/bin/loadkeys $KEYMAP 2>&1)"
+ # Add .inc suffix for known files, just in case, shouldn't be needed
+ INCLUDEMAPS=$(echo "$INCLUDEMAPS" | sed -E
's/\<(azerty-layout|compose|euro1|linux-keys-bare|linux-keys-extd|linux-with-alt-and-altgr|linux-with-modeshift-altgr|linux-with-two-alt-keys|qwerty-layout|qwertz-layout|apple-a1048-base|apple-a1243-fn-reverse|apple-a1243-fn|mac-azerty-layout|mac-linux-keys-bare|mac-qwerty-layout|mac-qwertz-layout)\>/&.inc/g')
+ /bin/loadkeys $KEYMAP $INCLUDEMAPS 2>&1
evaluate_retval
fi
- for a in $INCLUDEMAPS; do
- [[ $(find /usr/share/kbd/keymaps/ -type f -name "$a.inc*" 2>/dev/null)
]] &&
- [[ ! $(find /usr/share/kbd/keymaps/ -type f -name "$a.map*" 2>/dev/null)
]] &&
- a="$a.inc"
- echo "$(/bin/loadkeys $a 2>&1)"
- evaluate_retval
- done
-
[[ "$DEVICES" == "devfs" ]] && DEV_TTY="vc/" || DEV_TTY="tty"
if [[ "$UNICODE_START" ]]; then
@@ -39,16 +31,12 @@ start()
/bin/dumpkeys | /bin/loadkeys --unicode
fi
- if [[ "$TTY_NUMS" == '*' ]]; then
- TTY_NUMS=
- for a in $(grep ^tty.*: /etc/inittab); do
- TTY_NUMS="$TTY_NUMS $(expr "$a" : 'tty\([0-9]*\):.*')"
- done
- fi
+ [[ "$TTY_NUMS" == '*' ]] &&
+ TTY_NUMS=$(awk -F: '/^tty[0-9]*:/ { n=$1; sub(/^tty/, "", n); print n }'
/etc/inittab)
for n in $TTY_NUMS; do
echo "Loading settings for $DEV_TTY$n..."
- [[ "$UNICODE_START" ]] && /bin/echo -ne "\033%G" > /dev/$DEV_TTY$n
+ [[ "$UNICODE_START" ]] && echo -ne "\033%G" > /dev/$DEV_TTY$n
if [[ "$SETFONT_ARGS" ]]; then
/bin/setfont $SETFONT_ARGS -C /dev/$DEV_TTY$n
evaluate_retval
@@ -58,7 +46,7 @@ start()
[[ -f $dropfile ]] && rm $dropfile
STATUS_VARS="KEYMAP INCLUDEMAPS SETFONT_ARGS TTY_NUMS UNICODE_START
DEV_TTY"
for a in $STATUS_VARS; do
- /bin/echo "$a=\"${!a}\"" >> $dropfile
+ echo "$a=\"${!a}\"" >> $dropfile
done
}
@@ -71,7 +59,7 @@ stop()
[[ "$KEYMAP$INCLUDEMAPS" ]] &&
required_executable /bin/loadkeys &&
- echo "$(/bin/loadkeys defkeymap 2>&1)"
+ /bin/loadkeys defkeymap 2>&1
[[ "$UNICODE_START" ]] &&
required_executable /bin/unicode_stop &&
@@ -79,7 +67,7 @@ stop()
for n in $TTY_NUMS; do
echo "Unloading settings for $DEV_TTY$n..."
- [[ "$UNICODE_START" ]] && /bin/echo -ne '\033%@' > /dev/$DEV_TTY$n
+ [[ "$UNICODE_START" ]] && echo -ne '\033%@' > /dev/$DEV_TTY$n
if [[ "$SETFONT_ARGS" ]]; then
/bin/setfont default8x16 -C /dev/$DEV_TTY$n
evaluate_retval
- [[SM-Commit] ] GIT changes to master grimoire by Ismael Luceno (b850704d02d9a94d91b60aa737a4a2132571a202), Ismael Luceno, 06/09/2025
Archive powered by MHonArc 2.6.24.