[SM-Commit] GIT changes to master grimoire by Juuso Alasuutari (371a822624d9bbb6e5d0471b1f3173292539aba3)

Juuso Alasuutari scm at mail.sourcemage.org
Wed Aug 9 09:03:08 EDT 2006


GIT changes to master grimoire by Juuso Alasuutari <iuso at sourcemage.org>:

 shell-term-fm/bash/HISTORY         |    4 ++++
 shell-term-fm/bash/profile.d/lc.sh |   27 ++++++---------------------
 2 files changed, 10 insertions(+), 21 deletions(-)

New commits:
commit 371a822624d9bbb6e5d0471b1f3173292539aba3
Author: Juuso Alasuutari <iuso at sourcemage.org>
Commit: Juuso Alasuutari <iuso at sourcemage.org>

    bash: Fix bug #11759.

diff --git a/shell-term-fm/bash/HISTORY b/shell-term-fm/bash/HISTORY
index b7f9c8d..fe9fb20 100644
--- a/shell-term-fm/bash/HISTORY
+++ b/shell-term-fm/bash/HISTORY
@@ -1,3 +1,7 @@
+2006-08-09 Juuso Alasuutari <iuso at sourcemage.org>
+	* profile.d/lc.sh: Converted to standard sh (bug #11759), 
+	  simplified code.
+
 2006-07-03 Jaka Kranjc <lynxlynxlynx at sourcemage.org>
 	* profile: appended "unset i" #12581
 
diff --git a/shell-term-fm/bash/profile.d/lc.sh b/shell-term-fm/bash/profile.d/lc.sh
index 176be51..a8169cb 100644
--- a/shell-term-fm/bash/profile.d/lc.sh
+++ b/shell-term-fm/bash/profile.d/lc.sh
@@ -1,25 +1,10 @@
-#!/bin/bash
-# Enhancing support for locale support
-# First source the locale config then
-# if a var is set set it...
+#!/bin/sh
+# Source the locale config and export all variables that are set.
 
 . /etc/sysconfig/locale
 
-function export_if_set() {
-
-#if the variable whose name is in $1 is not empty
-
-if [[ -n ${!1} ]] 
-then
-  export $1
-fi
-}
-
-LOCALE_VARS="LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE \
-LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME \
-LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_ALL"
-
-for i in $LOCALE_VARS
-do
-  export_if_set "$i"
+for i in LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY \
+LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT \
+LC_ALL; do
+  eval [ \"'$'$i\" ] && export $i
 done



More information about the SM-Commit mailing list