]> err.no Git - dotfiles/commitdiff
Only set LANG if unset
authortfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Thu, 21 Apr 2005 22:44:15 +0000 (22:44 +0000)
committertfheen <tfheen@8da78d58-1cd3-0310-bee5-d77bd1b3e8bf>
Thu, 21 Apr 2005 22:44:15 +0000 (22:44 +0000)
git-svn-id: file:///svn/tfheen/trunk/dotfiles@753 8da78d58-1cd3-0310-bee5-d77bd1b3e8bf

environment

index 1d562fe87fae2a55ff5042d9035227c96482a785..097659a850736a3ae59071e71c9ca20cd81fdadb 100644 (file)
@@ -24,11 +24,12 @@ findcommand() {
             fi
             if [ -x "$D/$1" ]; then
                 echo "$D/$1"
-                return
+                return 0
             fi
         done
         shift
     done
+    return 1
 }
 
 blog () {
@@ -174,16 +175,18 @@ case `uname -s` in
         ;;
 esac
 
-if type -p locale > /dev/null 2>&1; then
-    if locale -a | grep -q '^no_NO$' ; then
-        LANG=no_NO
-    elif locale -a | grep -q '^en_US$'; then
-        LANG=en_US
+if [ -z "$LANG" ] || [ "$LANG" = "C" ]; then
+    if findcommand locale; then
+        if locale -a | grep -q '^no_NO$' ; then
+            LANG=no_NO
+        elif locale -a | grep -q '^en_US$'; then
+            LANG=en_US
+        fi
     fi
 fi
 
-if [ -z "$LANG" ]|| [ "$LANG" = "C" ]; then
-    if type -p localedef > /dev/null 2>&1; then
+if [ -z "$LANG" ] || [ "$LANG" = "C" ]; then
+    if findcommand localedef; then
         localedef --list-archive > /dev/null 2>&1
         if test "$?" = "0"; then
             if localedef --list-archive | grep -q '^no_NO$' ; then