tazbug rev 159

Remove ashism ==
author Pascal Bellard <pascal.bellard@slitaz.org>
date Tue Feb 26 08:28:10 2019 +0100 (2019-02-26)
parents 5228d61a7eac
children 86c2bff8ff74
files mv-open-closed.sh web/bugs.cgi web/plugins/mybugs/user.sh web/plugins/textmode/textmode.cgi web/plugins/users/users.cgi
line diff
     1.1 --- a/mv-open-closed.sh	Thu Jan 10 17:50:37 2019 +0100
     1.2 +++ b/mv-open-closed.sh	Tue Feb 26 08:28:10 2019 +0100
     1.3 @@ -19,7 +19,7 @@
     1.4  	if [ -f "${bug}/bug.conf" ]; then
     1.5  		. ./${bug}/bug.conf
     1.6  		echo  -n "Moving bug: ${bug} $STATUS"
     1.7 -		if [ "$STATUS" == "OPEN" ]; then
     1.8 +		if [ "$STATUS" = "OPEN" ]; then
     1.9  			mv ${bug} open/ && status
    1.10  		else
    1.11  			mv ${bug} closed/ && status
     2.1 --- a/web/bugs.cgi	Thu Jan 10 17:50:37 2019 +0100
     2.2 +++ b/web/bugs.cgi	Tue Feb 26 08:28:10 2019 +0100
     2.3 @@ -106,7 +106,7 @@
     2.4  	user="$(echo $auth | cut -d ":" -f 1)"
     2.5  	md5cookie="$(echo $auth | cut -d ":" -f 2)"
     2.6  	[ -f "$sessions/$user" ] && md5session="$(cat $sessions/$user)"
     2.7 -	if [ "$md5cookie" == "$md5session" ] && [ "$auth" ]; then
     2.8 +	if [ "$md5cookie" = "$md5session" ] && [ "$auth" ]; then
     2.9  		return 0
    2.10  	else
    2.11  		return 1
    2.12 @@ -179,7 +179,7 @@
    2.13  
    2.14  # Link for online signup if enabled.
    2.15  online_signup() {
    2.16 -	if [ "$ONLINE_SIGNUP" == "yes" ]; then
    2.17 +	if [ "$ONLINE_SIGNUP" = "yes" ]; then
    2.18  		echo -n "<a href='$script?signup&amp;online'>"
    2.19  		gettext "Sign Up Online"
    2.20  		echo '</a></p>'
    2.21 @@ -262,7 +262,7 @@
    2.22  		for id in $(ls $bugdir/$status)
    2.23  		do
    2.24  			. $bugdir/$status/$id/bug.conf
    2.25 -			if [ "$PRIORITY" == "$pr" ]; then
    2.26 +			if [ "$PRIORITY" = "$pr" ]; then
    2.27  				[ -f "${PEOPLE}/${CREATOR}/account.conf" ] && \
    2.28  					. ${PEOPLE}/${CREATOR}/account.conf
    2.29  				cat << EOT
    2.30 @@ -335,12 +335,12 @@
    2.31  	fi
    2.32  	echo '<div id="tools">'
    2.33  	if check_auth; then
    2.34 -		if [ "$STATUS" == "OPEN" ]; then
    2.35 +		if [ "$STATUS" = "OPEN" ]; then
    2.36  			cat << EOT
    2.37  <a href="?id=$id&amp;close">$(gettext "Close bug")</a>
    2.38  EOT
    2.39  		# Only original user and admin can edit a bug
    2.40 -		if [ "$user" == "$CREATOR" ] || admin_user; then
    2.41 +		if [ "$user" = "$CREATOR" ] || admin_user; then
    2.42  			cat << EOT
    2.43  <a href="?editbug=$id">$(gettext "Edit bug")</a>
    2.44  EOT
    2.45 @@ -356,7 +356,7 @@
    2.46  
    2.47  <h3>$(gettext "Messages")</h3>
    2.48  EOT
    2.49 -	[ "$msgs" == "0" ] && gettext "No messages"
    2.50 +	[ "$msgs" = "0" ] && gettext "No messages"
    2.51  	for msg in $(ls -1tr $bugdir/$id/msg.*)
    2.52  	do
    2.53  		#
    2.54 @@ -373,7 +373,7 @@
    2.55  			msgid=$(echo $msg | cut -d "." -f 2)
    2.56  			del=""
    2.57  			# User can delete his post as well as admin.
    2.58 -			if [ "$user" == "$USER" ] || admin_user; then
    2.59 +			if [ "$user" = "$USER" ] || admin_user; then
    2.60  				del="- <a href=\"?id=$id&amp;delmsg=$msgid\">delete</a>"
    2.61  			fi
    2.62  			cat << EOT
    2.63 @@ -498,7 +498,7 @@
    2.64  # Edit/Save a bug
    2.65  edit_bug() {
    2.66  	. $bugdir/$id/bug.conf
    2.67 -	if admin_user || [ "$user" == "$CREATOR" ]; then
    2.68 +	if admin_user || [ "$user" = "$CREATOR" ]; then
    2.69  		continue
    2.70  	else
    2.71  		gettext "You can't edit someone else's bug!" && exit 0
    2.72 @@ -605,7 +605,7 @@
    2.73  EOT
    2.74  	chmod 0600 $PEOPLE/$user/account.conf
    2.75  	# First created user is admin
    2.76 -	if [ $(ls ${PEOPLE} | wc -l) == "1" ]; then
    2.77 +	if [ $(ls ${PEOPLE} | wc -l) = "1" ]; then
    2.78  		echo "$user" > ${ADMIN_USERS}
    2.79  	fi
    2.80  }
    2.81 @@ -635,7 +635,7 @@
    2.82  		fi;
    2.83  
    2.84  		valid=$(fgrep "${user}:" $AUTH_FILE | cut -d ":" -f 2)
    2.85 -		if [ "$pass" == "$valid" ] && [ "$pass" != "" ]; then
    2.86 +		if [ "$pass" = "$valid" ] && [ "$pass" != "" ]; then
    2.87  			if [[ "$(POST id)" ]] ;then
    2.88  				IDLOC="?id=$(POST id)"
    2.89  			fi
    2.90 @@ -802,7 +802,7 @@
    2.91  		html_header
    2.92  		user_box
    2.93  		echo "<h2>$(gettext "Sign Up")</h2>"
    2.94 -		if [ "$ONLINE_SIGNUP" == "yes" ]; then
    2.95 +		if [ "$ONLINE_SIGNUP" = "yes" ]; then
    2.96  			signup_page
    2.97  		else
    2.98  			gettext "Online registration is disabled"
    2.99 @@ -844,7 +844,7 @@
   2.100  			fi
   2.101  			bugdir=$(dirname $bugdir)
   2.102  		done
   2.103 -		if [ "$found" == "0" ]; then
   2.104 +		if [ "$found" = "0" ]; then
   2.105  			echo "<p>$(gettext 'No result found for') : $(GET search)</p>"
   2.106  		else
   2.107  			echo "<p> $found $(gettext 'results found')</p>"
     3.1 --- a/web/plugins/mybugs/user.sh	Thu Jan 10 17:50:37 2019 +0100
     3.2 +++ b/web/plugins/mybugs/user.sh	Tue Feb 26 08:28:10 2019 +0100
     3.3 @@ -48,7 +48,7 @@
     3.4  
     3.5  if [ "$show_more" ]; then
     3.6  	echo "<p>"
     3.7 -	if [ "$HTTP_HOST" == "bugs.slitaz.org" ]; then
     3.8 +	if [ "$HTTP_HOST" = "bugs.slitaz.org" ]; then
     3.9  		echo "<a href='?mybugs&user=$user'>$(gettext 'View all my bugs and messages')</a>"
    3.10  	else
    3.11  		echo "$(gettext 'View all my bugs and debug messages on:') "
     4.1 --- a/web/plugins/textmode/textmode.cgi	Thu Jan 10 17:50:37 2019 +0100
     4.2 +++ b/web/plugins/textmode/textmode.cgi	Tue Feb 26 08:28:10 2019 +0100
     4.3 @@ -29,7 +29,7 @@
     4.4  			fi
     4.5  			bugdir=$(dirname $bugdir)
     4.6  		done
     4.7 -		if [ "$found" == "" ]; then
     4.8 +		if [ "$found" = "" ]; then
     4.9  			echo "No result found for: $(GET search)"
    4.10  		else
    4.11  			separator && echo "$found result(s) found"
     5.1 --- a/web/plugins/users/users.cgi	Thu Jan 10 17:50:37 2019 +0100
     5.2 +++ b/web/plugins/users/users.cgi	Tue Feb 26 08:28:10 2019 +0100
     5.3 @@ -197,7 +197,7 @@
     5.4  $(gettext "User name  :") $USER
     5.5  $(gettext "Last login :") $last
     5.6  EOT
     5.7 -		if check_auth && [ "$(GET user)" == "$user" ]; then
     5.8 +		if check_auth && [ "$(GET user)" = "$user" ]; then
     5.9  			auth_people
    5.10  		else
    5.11  			# check_auth will set VARS to current logged user: re-source