summaryrefslogtreecommitdiffstats
path: root/install/keymap
diff options
context:
space:
mode:
Diffstat (limited to 'install/keymap')
-rw-r--r--install/keymap24
1 files changed, 14 insertions, 10 deletions
diff --git a/install/keymap b/install/keymap
index 34b744a..2cf4d15 100644
--- a/install/keymap
+++ b/install/keymap
@@ -1,18 +1,22 @@
#!/bin/bash
build() {
- SCRIPT=keymap
- eval "$(grep -E "^(LOCALE|KEYMAP)=" /etc/rc.conf)"
- if [[ $KEYMAP ]]; then
- if [[ $LOCALE = *[Uu][Tt][Ff]-8 ]]; then
- printf '%s\n' "UTF8=yes" > "$BUILDROOT/keymap.utf8"
- /bin/loadkeys -q -u $KEYMAP -b > "$BUILDROOT/keymap.bin"
- else
- printf '%s\n' "UTF8=no" > "$BUILDROOT/keymap.utf8"
- /bin/loadkeys -q $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ # subshell to avoid namespace pollution
+ (
+ . "$BASEDIR/etc/rc.conf"
+ if [[ $KEYMAP ]]; then
+ if [[ $LOCALE = *[Uu][Tt][Ff]-8 ]]; then
+ printf '%s\n' "UTF8=yes" > "$BUILDROOT/keymap.utf8"
+ /bin/loadkeys -q -u $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ else
+ printf '%s\n' "UTF8=no" > "$BUILDROOT/keymap.utf8"
+ /bin/loadkeys -q $KEYMAP -b > "$BUILDROOT/keymap.bin"
+ fi
fi
- fi
+ )
+
+ (( $? == 0 )) && SCRIPT=keymap
}
help() {