From bcc0abeb27498124fcfe7770d590c1fb9c69076c Mon Sep 17 00:00:00 2001 From: Michael Prokop Date: Tue, 6 Feb 2007 20:48:27 +0100 Subject: [PATCH] fix bashism in several scripts, thanks ft --- debian/changelog | 19 +++++++++++++++++++ usr_bin/attach-screen | 2 +- usr_bin/grml-config-user | 2 +- usr_bin/grml-lang | 22 +++++++++++----------- usr_bin/grml-mutt | 2 +- usr_bin/grml-muttng | 2 +- usr_bin/grml-slrn | 4 ++-- usr_bin/grml-start | 4 ++-- usr_bin/say | 4 ++-- usr_sbin/grml-config | 2 +- usr_sbin/grml-config-root | 2 +- usr_sbin/make_chroot_jail | 2 +- 12 files changed, 43 insertions(+), 24 deletions(-) diff --git a/debian/changelog b/debian/changelog index b7caddd..ab90e3b 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,22 @@ +grml-scripts (0.9.13) unstable; urgency=low + + * The 'fix bashism in several scripts' release. Thanks + to ft for the patches! + + - say: fix bashism [Closes: issue114] + - make_chroot_jail: fix bashism [Closes: issue113] + - grml-start: fix bashism [Closes: issue112] + - grml-slrn: fix bashism [Closes: issue111] + - grml-muttng: fix bashism [Closes: issue110] + - grml-mutt: fix bashism [Closes: issue109] + - grml-lang: fix bashism [Closes: issue108] + - grml-config: fix bashism [Closes: issue107] + - grml-config-user: fix bashism [Closes: issue106] + - grml-config-root: fix bashism [Closes: issue105] + - attach-screen: fix bashism [Closes: issue103] + + -- Michael Prokop Tue, 6 Feb 2007 20:38:40 +0100 + grml-scripts (0.9.12) unstable; urgency=low * Update make_chroot_jail script (see diff --git a/usr_bin/attach-screen b/usr_bin/attach-screen index ba55fb5..967be68 100755 --- a/usr_bin/attach-screen +++ b/usr_bin/attach-screen @@ -8,7 +8,7 @@ ################################################################################ # -U option basically means "terminal does not have UTF-8 support" -if [ "$1" == "-U" ]; then +if [ x$1 = "x-U" ]; then unset LC_CTYPE fi diff --git a/usr_bin/grml-config-user b/usr_bin/grml-config-user index 360e359..db261be 100755 --- a/usr_bin/grml-config-user +++ b/usr_bin/grml-config-user @@ -13,7 +13,7 @@ PATH=${PATH:-'/bin/:/sbin/:/usr/bin:/usr/sbin'} DIALOG=$(which dialog) PN=$(basename $0) -function allover() { +allover() { MENU=$($DIALOG --stdout --clear --title "$PN" --menu \ "Configure userland tools." 0 0 0 \ "grml-mutt" "Configure the mutt MUA" \ diff --git a/usr_bin/grml-lang b/usr_bin/grml-lang index 68c8a4d..2ded458 100755 --- a/usr_bin/grml-lang +++ b/usr_bin/grml-lang @@ -12,25 +12,25 @@ usage(){ echo "supported values: at, de, ch, us" } -if [[ $# -lt "1" ]] ; then +if [ $# -lt "1" ] ; then usage exit -1 fi -if [[ $DISPLAY == "" ]] ;then - if [[ "$1" == "de" ]] ; then +if [ -z "$DISPLAY" ] ;then + if [ "$1" = "de" ] ; then echo "Loading keymap for Germany..." sudo loadkeys i386/qwertz/de-latin1-nodeadkeys.kmap.gz echo -e "\nDone." - elif [[ "$1" == "at" ]] ; then + elif [ "$1" = "at" ] ; then echo "Loading keymap for Austria..." sudo loadkeys i386/qwertz/de-latin1-nodeadkeys.kmap.gz echo -e "\nDone." - elif [[ "$1" == "ch" ]] ; then + elif [ "$1" = "ch" ] ; then echo "Loading keymap for Switzerland..." sudo loadkeys i386/qwertz/sg-latin1.kmap.gz echo -e "\nDone." - elif [[ "$1" == "us" ]] ; then + elif [ "$1" = "us" ] ; then echo 'Loading keymap us...' # sudo loadkeys /etc/console/boottime.kmap.gz sudo loadkeys i386/qwerty/us-latin1.kmap.gz @@ -41,23 +41,23 @@ Notice: Use loadkeys on console and setxkbmap when running X for modifying keyboard layout. Adjust \$LANG and \$LC_ALL for setting locales." ; exit 1 fi else - if [[ $# == "0" ]] ; then + if [ $# = 0 ] ; then echo "Usage: $0 " echo "supported values: at, de, ch, us" else - if [[ "$1" == "de" ]] ; then + if [ "$1" = "de" ] ; then echo "Loading keymap for Germany..." [ -r $HOME/.Xmodmap.german ] && xmodmap $HOME/.Xmodmap.german || setxkbmap de echo -e "\nDone." - elif [[ "$1" == "at" ]] ; then + elif [ "$1" = "at" ] ; then echo "Loading keymap for Austria..." setxkbmap de echo -e "\nDone." - elif [[ "$1" == "ch" ]] ; then + elif [ "$1" = "ch" ] ; then echo "Loading keymap for Switzerland..." setxkbmap ch echo -e "\nDone." - elif [[ "$1" == "us" ]] ; then + elif [ "$1" = "us" ] ; then echo 'Loading keymap us...' [ -r $HOME/.Xmodmap ] && xmodmap $HOME/.Xmodmap || setxkbmap us echo -e "\nDone." diff --git a/usr_bin/grml-mutt b/usr_bin/grml-mutt index 135ad3c..589573e 100755 --- a/usr_bin/grml-mutt +++ b/usr_bin/grml-mutt @@ -362,7 +362,7 @@ case $retval in esac writecolors() { - if [ "$COLOR" == 'light' ] ; then + if [ "$COLOR" = 'light' ] ; then lightcolors fi } diff --git a/usr_bin/grml-muttng b/usr_bin/grml-muttng index c539562..55cc240 100755 --- a/usr_bin/grml-muttng +++ b/usr_bin/grml-muttng @@ -389,7 +389,7 @@ case $retval in esac writecolors() { - if [ "$COLOR" == 'light' ] ; then + if [ "$COLOR" = 'light' ] ; then lightcolors fi } diff --git a/usr_bin/grml-slrn b/usr_bin/grml-slrn index 8ba20f5..8dea352 100755 --- a/usr_bin/grml-slrn +++ b/usr_bin/grml-slrn @@ -293,10 +293,10 @@ case $retval in esac writecolors() { - if [ "$COLOR" == 'light' ] ; then + if [ "$COLOR" = 'light' ] ; then lightcolors fi - if [ "$COLOR" == 'dark' ] ; then + if [ "$COLOR" = 'dark' ] ; then darkcolors fi } diff --git a/usr_bin/grml-start b/usr_bin/grml-start index 9bc28cc..415568a 100755 --- a/usr_bin/grml-start +++ b/usr_bin/grml-start @@ -7,8 +7,8 @@ # Latest change: Fre Jul 07 22:42:40 CEST 2006 [mika] ################################################################################ - (( ${+BROWSER} )) || BROWSER="w3m" -#(( ${+BROWSER} )) || BROWSER="links2 -driver fb" +BROWSER=${BROWSER:-w3m} +#BROWSER=${BROWSER:-links2 -driver fb} exec $BROWSER /usr/share/doc/grml-docs/startpage.html ## END OF FILE ################################################################# diff --git a/usr_bin/say b/usr_bin/say index 4985ce6..9041d08 100755 --- a/usr_bin/say +++ b/usr_bin/say @@ -4,10 +4,10 @@ # Authors: grml-team (grml.org), (c) Michael Prokop # Bug-Reports: see http://grml.org/bugs/ # License: This file is licensed under the GPL v2. -# Latest change: Son Jän 30 14:38:30 CET 2005 [mika] +# Latest change: Die Feb 06 20:38:24 CET 2007 [mika] ################################################################################ -if [[ "$#" -eq '0' ]] ; then +if [ $# -eq 0 ] ; then echo "Usage: $0 " exit -1 fi diff --git a/usr_sbin/grml-config b/usr_sbin/grml-config index 208beb8..b7d1a2f 100755 --- a/usr_sbin/grml-config +++ b/usr_sbin/grml-config @@ -19,7 +19,7 @@ else DEFAULTITEM=root fi -function allover() { +allover() { MENU=$($DIALOG --stdout --clear --title "$PN" --default-item $DEFAULTITEM --menu \ "Please select the scripts you would like to run. diff --git a/usr_sbin/grml-config-root b/usr_sbin/grml-config-root index 55a5287..f4d5515 100755 --- a/usr_sbin/grml-config-root +++ b/usr_sbin/grml-config-root @@ -19,7 +19,7 @@ then exit 100 fi -function allover() { +allover() { MENU=$($DIALOG --stdout --clear --title "$PN" --menu \ "Configure your grml system. diff --git a/usr_sbin/make_chroot_jail b/usr_sbin/make_chroot_jail index cd47e38..5ac16c1 100755 --- a/usr_sbin/make_chroot_jail +++ b/usr_sbin/make_chroot_jail @@ -261,7 +261,7 @@ Copying files in $CHROOT_USERNAME's \$HOME to \"$HOMEDIR\" usermod -d "$HOMEDIR" -m -s "$SHELL" $CHROOT_USERNAME && chmod 700 "$HOMEDIR" fi -if [ "$CREATEUSER" == "yes" ] ; then { +if [ "$CREATEUSER" = "yes" ] ; then { echo "Adding User \"$CHROOT_USERNAME\" to system" useradd -m -d "$HOMEDIR" -s "$SHELL" $CHROOT_USERNAME && chmod 700 "$HOMEDIR" -- 2.1.4