Blame 0035-i18n-module-setup.sh-s-error-info-if-no-keymap-is-co.patch

Harald Hoyer 2d3fda
From 394ffc1d979d47d6ec4c0419ea13e98e1b781bd5 Mon Sep 17 00:00:00 2001
Harald Hoyer 2d3fda
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 2d3fda
Date: Thu, 5 Jul 2012 10:28:56 +0200
Harald Hoyer 2d3fda
Subject: [PATCH] i18n/module-setup.sh: s/error/info if no keymap is
Harald Hoyer 2d3fda
 configured
Harald Hoyer 2d3fda
Harald Hoyer 2d3fda
https://bugzilla.redhat.com/show_bug.cgi?id=836418
Harald Hoyer 2d3fda
---
Harald Hoyer 2d3fda
 modules.d/10i18n/module-setup.sh |   11 +++++++----
Harald Hoyer 2d3fda
 1 file changed, 7 insertions(+), 4 deletions(-)
Harald Hoyer 2d3fda
Harald Hoyer 2d3fda
diff --git a/modules.d/10i18n/module-setup.sh b/modules.d/10i18n/module-setup.sh
Harald Hoyer 2d3fda
index a7ddc82..a1cf1c8 100755
Harald Hoyer 2d3fda
--- a/modules.d/10i18n/module-setup.sh
Harald Hoyer 2d3fda
+++ b/modules.d/10i18n/module-setup.sh
Harald Hoyer 2d3fda
@@ -74,9 +74,11 @@ install() {
Harald Hoyer 2d3fda
             for map in ${item[1]//,/ }
Harald Hoyer 2d3fda
             do
Harald Hoyer 2d3fda
                 map=(${map//-/ })
Harald Hoyer 2d3fda
-                value=$(grep "^${map[0]}=" "${item[0]}")
Harald Hoyer 2d3fda
-                value=${value#*=}
Harald Hoyer 2d3fda
-                echo "${map[1]:-${map[0]}}=${value}"
Harald Hoyer 2d3fda
+                if [[ -f "${item[0]}" ]]; then
Harald Hoyer 2d3fda
+                    value=$(grep "^${map[0]}=" "${item[0]}")
Harald Hoyer 2d3fda
+                    value=${value#*=}
Harald Hoyer 2d3fda
+                    echo "${map[1]:-${map[0]}}=${value}"
Harald Hoyer 2d3fda
+                fi
Harald Hoyer 2d3fda
             done
Harald Hoyer 2d3fda
         done
Harald Hoyer 2d3fda
     }
Harald Hoyer 2d3fda
@@ -155,9 +157,10 @@ install() {
Harald Hoyer 2d3fda
         EXT_KEYMAPS+=\ ${UNIKEYMAP}\ ${GRP_TOGGLE}
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
         [[ ${KEYMAP} ]] || {
Harald Hoyer 2d3fda
-            derror 'No KEYMAP.'
Harald Hoyer 2d3fda
+            dinfo 'No KEYMAP configured.'
Harald Hoyer 2d3fda
             return 1
Harald Hoyer 2d3fda
         }
Harald Hoyer 2d3fda
+
Harald Hoyer 2d3fda
         findkeymap ${KEYMAP}
Harald Hoyer 2d3fda
 
Harald Hoyer 2d3fda
         for map in ${EXT_KEYMAPS}