Whamcloud - gitweb
tune2fs: fix BUGs of tuning project quota
[tools/e2fsprogs.git] / lib / ss / mk_cmds.sh.in
index b9a4417..0abc19d 100644 (file)
@@ -3,11 +3,22 @@
 #
 
 datarootdir=@datarootdir@
-DIR="${DIR-@datadir@/ss}"
-SS_DIR="@SS_DIR@"
+DIR=@datadir@/ss
 AWK=@AWK@
 SED=@SED@
 
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    $as_unset $as_var
+  fi
+done
+
 if test "x$1" = x ; then
     echo "Usage: mk_cmds file"
     exit 1
@@ -18,12 +29,8 @@ if test -n "$_SS_DIR_OVERRIDE" ; then
 fi
 
 if test ! -f $DIR/ct_c.sed || test ! -f $DIR/ct_c.awk ; then
-    DIR="$SS_DIR"
-#    echo "Falling back to $DIR..."
-    if test ! -f "$DIR/ct_c.sed" || test ! -f "$DIR/ct_c.awk" ; then
-       echo "mk_cmds: Couldn't find mk_cmds's template files."
-       exit 1
-    fi
+    echo "mk_cmds: Couldn't find mk_cmds's template files."
+    exit 1
 fi
 
 FILE="$1"
@@ -32,7 +39,7 @@ BASE=`basename "$ROOT"`
 TMP="ct$$.c"
 
 if test ! -f "$FILE" ; then
-    echo "$FILE: File not found"
+    echo "mk_cmds: $FILE: File not found"
     exit 1;
 fi
 
@@ -45,6 +52,6 @@ if grep "^#__ERROR_IN_FILE" "${TMP}" > /dev/null; then
 else
        rm -f "${BASE}.c"
        mv -f "${TMP}" "${BASE}.c"
-       chmod -w "${BASE}.c"
+       chmod a-w "${BASE}.c"
        exit 0
 fi