- SC2086: Double quote to prevent globbing and word splitting.
- SC2034: CMDLINE appears unused. Verify use (or export if used externally).
- Ignore SC1091: Not following: /etc/grml/script-functions was not specified as input (see shellcheck -x).
- Ignore SC1091: Not following: /etc/grml/lsb-functions was not specified as input (see shellcheck -x).
- Ignore SC1117: Backslash is literal in "\#". Prefer explicit escaping: "\\#".
- Ignore SC1091: Not following: /etc/environment was not specified as input (see shellcheck -x).
- Ignore SC1091: Not following: /etc/default/locale was not specified as input (see shellcheck -x).
- Ignore SC1010: Use semicolon or linefeed before 'fi' (or quote to make it literal).
- SC2086: Double quote to prevent globbing and word splitting.
- Ignore SC1090: Can't follow non-constant source. Use a directive to specify location.
- SC2086: Double quote to prevent globbing and word splitting.
# License: This file is licensed under the GPL v2.
################################################################################
# License: This file is licensed under the GPL v2.
################################################################################
LANGFUNC=/etc/grml/language-functions
# notice: Debian's locales.postinst has been modified to write
LANGFUNC=/etc/grml/language-functions
# notice: Debian's locales.postinst has been modified to write
# so modifying it was a policy violation.
CONFFILE=/etc/default/locale
# so modifying it was a policy violation.
CONFFILE=/etc/default/locale
+# shellcheck disable=SC1091
+{
. /etc/grml/script-functions
. /etc/grml/lsb-functions
. /etc/grml/script-functions
. /etc/grml/lsb-functions
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
# is the new Debian style /etc/default/locale present?
elif grep -q "^# ${1}$" "$CONFFILE" ; then
+ # shellcheck disable=SC1117
sed -i "s#^\# ${1}#${1}${2}#" $CONFFILE
else
echo "$1${2}" >> $CONFFILE
sed -i "s#^\# ${1}#${1}${2}#" $CONFFILE
else
echo "$1${2}" >> $CONFFILE
+# shellcheck disable=SC1091
+{
[ -r /etc/environment ] && . /etc/environment
[ -r /etc/default/locale ] && . /etc/default/locale
[ -r /etc/environment ] && . /etc/environment
[ -r /etc/default/locale ] && . /etc/default/locale
[ -n "$LANGUAGE" ] && DEFAULT_LANGUAGE="$LANGUAGE"
if [ -z "$DEFAULT_LANGUAGE" ] ; then
[ -n "$LANGUAGE" ] && DEFAULT_LANGUAGE="$LANGUAGE"
if [ -z "$DEFAULT_LANGUAGE" ] ; then
fi
if [ -z "$NONINTERACTIVE" ] ; then
fi
if [ -z "$NONINTERACTIVE" ] ; then
+# shellcheck disable=SC1010
+{
LANGUAGE=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \
"Which language do you want to use?
LANGUAGE=$(LANG=C $DIALOG --stdout --title "$PN" --default-item $DEFAULT_LANGUAGE --radiolist \
"Which language do you want to use?
us 'american (unicode version)' off \
us-iso 'american (iso version)' off \
)
us 'american (unicode version)' off \
us-iso 'american (iso version)' off \
)
retval=$?
case $retval in
retval=$?
case $retval in
# fallback to C if using an ISO system (which is latin1 for LC_CTYPE);
# this should prevent users from broken ctype settings if the set
# locale isn't available on a remote system
# fallback to C if using an ISO system (which is latin1 for LC_CTYPE);
# this should prevent users from broken ctype settings if the set
# locale isn't available on a remote system
-if echo $LANGUAGE | grep -q -- '-iso' ; then
+if echo "$LANGUAGE" | grep -q -- '-iso' ; then
LC_CTYPE=C
fi
# read in the file where all the $LANGUAGE stuff is defined
LC_CTYPE=C
fi
# read in the file where all the $LANGUAGE stuff is defined
+# shellcheck disable=SC1090
+. $LANGFUNC
# make sure the file exists
if ! [ -r $CONFFILE ] ; then
# make sure the file exists
if ! [ -r $CONFFILE ] ; then
+setvalue 'LANG=' "$LANG"
retval=$?
case $retval in
retval=$?
case $retval in