From 8f54c3cf155da2362aac1595b603cb7eef665c2f Mon Sep 17 00:00:00 2001 From: Pascal Bellard Date: Tue, 26 Feb 2019 08:22:10 +0100 Subject: [PATCH] Remove ashism == --- rootfs/lib/libtaz.sh | 4 ++-- rootfs/usr/bin/ipinfo | 2 +- rootfs/usr/bin/man | 6 +++--- rootfs/usr/lib/slitaz/httphelper.sh | 4 ++-- rootfs/usr/lib/slitaz/libpkg.sh | 2 +- test-libtaz.sh | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/rootfs/lib/libtaz.sh b/rootfs/lib/libtaz.sh index e28b0c7..54166ee 100755 --- a/rootfs/lib/libtaz.sh +++ b/rootfs/lib/libtaz.sh @@ -200,7 +200,7 @@ confirm() { translate_query "$answer"; echo ' (auto)' fi # Return true/false to use in conditions - [ "$answer" == "$(translate_query y)" -o "$answer" == "$(translate_query Y)" ] + [ "$answer" = "$(translate_query y)" -o "$answer" = "$(translate_query Y)" ] } # Log activities @@ -250,7 +250,7 @@ footer() { saved_action='' action() { saved_action="$(_n "$@")" - [ "$quiet" == 'yes' ] && return + [ "$quiet" = 'yes' ] && return local w c scol msg chars # Translators: 'w' is the width the wider translated message ('[ Done ]' or '[ Failed ]') takes in a terminal; place here the number w=$(_ 'w'); w=${w/w/10} diff --git a/rootfs/usr/bin/ipinfo b/rootfs/usr/bin/ipinfo index 5bfdebe..b312981 100755 --- a/rootfs/usr/bin/ipinfo +++ b/rootfs/usr/bin/ipinfo @@ -4,7 +4,7 @@ # . /etc/network.conf -if [ "$WIFI" == "yes" ]; then +if [ "$WIFI" = "yes" ]; then iface="$WIFI_INTERFACE" else iface="$INTERFACE" diff --git a/rootfs/usr/bin/man b/rootfs/usr/bin/man index 8602fb8..8f2e754 100755 --- a/rootfs/usr/bin/man +++ b/rootfs/usr/bin/man @@ -108,7 +108,7 @@ if [ -n "$MANPAGE" ]; then # Use nroff if available; it outputs control chars, which busybox less # cannot handle: use "more" instead (or GNU less) if [ -x /usr/bin/nroff ]; then - if [ x$(readlink $(which less)) == x/bin/busybox ]; then + if [ x$(readlink $(which less)) = x/bin/busybox ]; then VIEW_CMD="more" else VIEW_CMD="less -rM" @@ -127,10 +127,10 @@ if [ -n "$MANPAGE" ]; then fi fi -if [ "$SECTION" == 'all' ]; then +if [ "$SECTION" = 'all' ]; then #search alphabetically LETTER=$(printf "${TOPIC::1}" | tr 'A-Z[:punct:][:digit:]' a-z00) - if [ $LETTER == '0' ]; then LETTER=other; fi + if [ $LETTER = '0' ]; then LETTER=other; fi SECTIONS=$(wget -q -O - http://linux.die.net/man/$LETTER.html | \ sed -n -r "s%.*href=\"(.)/$TOPIC\".*%\1%p") [ -n "$SECTIONS" ] || { _ 'No manual entry for %s' "$TOPIC"; exit 0;} diff --git a/rootfs/usr/lib/slitaz/httphelper.sh b/rootfs/usr/lib/slitaz/httphelper.sh index 985cfe6..3ce0968 100755 --- a/rootfs/usr/lib/slitaz/httphelper.sh +++ b/rootfs/usr/lib/slitaz/httphelper.sh @@ -157,8 +157,8 @@ ddcut() { } -[ "$1" == "--skip-post" ] || -if [ "$REQUEST_METHOD$POST__NAMES" == "POST" ]; then +[ "$1" = "--skip-post" ] || +if [ "$REQUEST_METHOD$POST__NAMES" = "POST" ]; then prefix=/tmp/httpd_post mkdir $prefix$$ now=$(stat -c %Y $prefix$$) diff --git a/rootfs/usr/lib/slitaz/libpkg.sh b/rootfs/usr/lib/slitaz/libpkg.sh index c8a362a..90e5c1b 100755 --- a/rootfs/usr/lib/slitaz/libpkg.sh +++ b/rootfs/usr/lib/slitaz/libpkg.sh @@ -32,7 +32,7 @@ check_mirror_id() { _n 'Mirror is unreachable' false; status; return 1 fi - if [ "$(cat ID)" == "$(cat ID.bak)" ]; then + if [ "$(cat ID)" = "$(cat ID.bak)" ]; then _n 'Mirror is up-to-date' true; status; return 1 fi diff --git a/test-libtaz.sh b/test-libtaz.sh index c176401..22ec323 100755 --- a/test-libtaz.sh +++ b/test-libtaz.sh @@ -4,7 +4,7 @@ [ $# -eq 0 ] && title 'Check variables import using libtaz.sh' -if [ "$1" == 'test' ]; then env; exit 0; fi +if [ "$1" = 'test' ]; then env; exit 0; fi ME=$(realpath $0); n=/tmp/n; echo 1 > $n; tests=18