projects
/
grml-scripts-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Drop runit manpage. Thanks for the hint, gebi
[grml-scripts-core.git]
/
usr_sbin
/
grml-setlang
diff --git
a/usr_sbin/grml-setlang
b/usr_sbin/grml-setlang
index
7079e76
..
f8cb28b
100755
(executable)
--- a/
usr_sbin/grml-setlang
+++ b/
usr_sbin/grml-setlang
@@
-4,7
+4,7
@@
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
# Authors: grml-team (grml.org), (c) Michael Prokop <mika@grml.org>
# Bug-Reports: see http://grml.org/bugs/
# License: This file is licensed under the GPL v2.
-# Latest change:
Fre Mär 16 22:49:29 CE
T 2007 [mika]
+# Latest change:
Mit Sep 05 18:33:23 CES
T 2007 [mika]
################################################################################
PN="$(basename $0)"
################################################################################
PN="$(basename $0)"
@@
-40,8
+40,11
@@
fi
setvalue(){
[ -n "$2" ] || return 1
# already present in conffile?
setvalue(){
[ -n "$2" ] || return 1
# already present in conffile?
- if grep -q ${1} $CONFFILE ; then
- sed -i "s#^${1}.*#${1}${2}#" $CONFFILE
+ if grep -q "^${1}" "$CONFFILE" ; then
+ sed -i "s#^${1}.*#${1}${2}#" $CONFFILE
+ # is the new Debian style /etc/default/locale present?
+ elif grep -q "^# ${1}$" "$CONFFILE" ; then
+ sed -i "s#^\# ${1}#${1}${2}#" $CONFFILE
else
echo "$1${2}" >> $CONFFILE
fi
else
echo "$1${2}" >> $CONFFILE
fi
@@
-50,7
+53,7
@@
setvalue(){
# grml-small does not provide any further locales
if grep -q small /etc/grml_version 2>/dev/null ; then
if [ -z "$NONINTERACTIVE" ] ; then
# grml-small does not provide any further locales
if grep -q small /etc/grml_version 2>/dev/null ; then
if [ -z "$NONINTERACTIVE" ] ; then
- $DIALOG --stdout --msgbox "Notice: grml-small does not provide a full language setup.
+
LANG=C
$DIALOG --stdout --msgbox "Notice: grml-small does not provide a full language setup.
You have to make sure the appropriate packages are installed." 0 0
exit 1
You have to make sure the appropriate packages are installed." 0 0
exit 1
@@
-68,14
+71,14
@@
if [ -z "$DEFAULT_LANGUAGE" ] ; then
fi
if [ -z "$NONINTERACTIVE" ] ; then
fi
if [ -z "$NONINTERACTIVE" ] ; then
- LANGUAGE=$($DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \
+ LANGUAGE=$(
LANG=C
$DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \
"Which language do you want to use?
This will affect \$LANG, \$LANGUAGE and \$LC_MESSAGES.
Notice: if you want to adjust /etc/locale.gen (defines
which locales should be generated by locale-gen)
"Which language do you want to use?
This will affect \$LANG, \$LANGUAGE and \$LC_MESSAGES.
Notice: if you want to adjust /etc/locale.gen (defines
which locales should be generated by locale-gen)
-please run 'dpkg-reconfigure locale' manually.
+please run 'dpkg-reconfigure locale
s
' manually.
Configuration will be written to $CONFFILE" 0 0 0 \
at 'austria (unicode version)' off \
Configuration will be written to $CONFFILE" 0 0 0 \
at 'austria (unicode version)' off \
@@
-159,7
+162,7
@@
else # non-interactive
LANGUAGE="$1"
fi
LANGUAGE="$1"
fi
-if ! grep -q
"${LANGUAGE})
" $LANGFUNC ; then
+if ! grep -q
e "${LANGUAGE})" -qe "${LANGUAGE}|
" $LANGFUNC ; then
ewarn "Language ${LANGUAGE} not supported, using default." ; eend 0
fi
ewarn "Language ${LANGUAGE} not supported, using default." ; eend 0
fi
@@
-191,7
+194,7
@@
retval=$?
case $retval in
(0)
if [ -z "$NONINTERACTIVE" ] ; then
case $retval in
(0)
if [ -z "$NONINTERACTIVE" ] ; then
- $DIALOG --stdout --msgbox "Writing language settings ($LANGUAGE) to $CONFFILE was successful." 0 0
+
LANG=C
$DIALOG --stdout --msgbox "Writing language settings ($LANGUAGE) to $CONFFILE was successful." 0 0
else
einfo "Writing language settings ($LANGUAGE) to $CONFFILE was successful."
esyslog user.notice "$PN" "Writing language settings ($LANGUAGE) to $CONFFILE was successful." ; eend 0
else
einfo "Writing language settings ($LANGUAGE) to $CONFFILE was successful."
esyslog user.notice "$PN" "Writing language settings ($LANGUAGE) to $CONFFILE was successful." ; eend 0
@@
-199,7
+202,7
@@
case $retval in
;;
*)
if [ -z "$NONINTERACTIVE" ] ; then
;;
*)
if [ -z "$NONINTERACTIVE" ] ; then
- $DIALOG --stdout --msgbox "Error writing settings for $LANGUAGE to $CONFFILE." 0 0
+
LANG=C
$DIALOG --stdout --msgbox "Error writing settings for $LANGUAGE to $CONFFILE." 0 0
else
eerror "Error writing settings for $LANGUAGE to $CONFFILE." ; eend 1
esyslog user.notice "$PN" "Error writing settings for $LANGUAGE to $CONFFILE."
else
eerror "Error writing settings for $LANGUAGE to $CONFFILE." ; eend 1
esyslog user.notice "$PN" "Error writing settings for $LANGUAGE to $CONFFILE."