Skip to contentSkip to conversation

tags.sh: fix string equality testing

PATCH In review Jiri Slaby 3 participants 3 messages Dec 10, 2008 – Dec 13, 2008 Kbuild

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 tags.sh: fix string equality testing

Test of string equality in shells is =, not C-like ==.

---
 scripts/tags.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
scripts/tags.sh +5 -5
index 3b7225c..6f49398 100644
@@ -7,7 +7,7 @@
 # Uses the following environment variables:
 # ARCH, SUBARCH, srctree, src, obj
 
-if [ $KBUILD_VERBOSE == 1 ]; then
+if [ $KBUILD_VERBOSE = 1 ]; then
 	set -x
 fi
 
@@ -18,7 +18,7 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
           -prune -o"
 
 # Do not use full path is we do not use O=.. builds
-if [ ${src} == ${obj} ]; then
+if [ ${src} = ${obj} ]; then
 	tree=
 else
 	tree=${srctree}/
@@ -135,10 +135,10 @@ xtags()
 
 
 # Support um (which uses SUBARCH)
-if [ ${ARCH} == um ]; then
-	if [ $SUBARCH == i386 ]; then
+if [ ${ARCH} = um ]; then
+	if [ $SUBARCH = i386 ]; then
 		archinclude=x86
-	elif [ $SUBARCH == x86_64 ]; then
+	elif [ $SUBARCH = x86_64 ]; then
 		archinclude=x86
 	else
 		archinclude=${SUBARCH}
Signature · 1 line
1.6.0.5
#1 lore raw

scripts/tags.sh line 10

Quoted 3 lines · Jiri Slaby

Test of string equality in shells is =, not C-like ==.

scripts/tags.sh +1 -1
-if [ $KBUILD_VERBOSE == 1 ]; then
+if [ $KBUILD_VERBOSE = 1 ]; then

also it is better to use quotes, because `[' gets $IFS'ed parameters otherwise:

|> +if [ "$KBUILD_VERBOSE" = 1 ]; then

Signature · 4 lines
sed 'sed && sh + olecom = love'  <<  ''
-o--=O`C
 #oo'L O
<___=E M
#2 lore raw
In reply to Jiri Slaby
Quoted 3 lines · Jiri Slaby

Test of string equality in shells is =, not C-like ==.

Here I also did some local modifcations.
See below.

Sam

From 91a70f60c285587826702a93ae924e7b9d761f94 Mon Sep 17 00:00:00 2001
From: Jiri Slaby <[email protected]>
Date: Wed, 10 Dec 2008 13:48:38 +0100
Subject: [PATCH] kbuild: fix string equality testing in tags.sh

Test of string equality in shells is =, not C-like ==.

---
 scripts/tags.sh |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
scripts/tags.sh +5 -5
index 3c814ba..4e75472 100755
@@ -7,7 +7,7 @@
 # Uses the following environment variables:
 # ARCH, SUBARCH, srctree, src, obj
 
-if [ $KBUILD_VERBOSE == 1 ]; then
+if [ "$KBUILD_VERBOSE" = "1" ]; then
 	set -x
 fi
 
@@ -18,7 +18,7 @@ ignore="( -name SCCS -o -name BitKeeper -o -name .svn -o \
           -prune -o"
 
 # Do not use full path is we do not use O=.. builds
-if [ "${KBUILD_SRC}" == "" ]; then
+if [ "${KBUILD_SRC}" = "" ]; then
 	tree=
 else
 	tree=${srctree}/
@@ -135,10 +135,10 @@ xtags()
 
 
 # Support um (which uses SUBARCH)
-if [ ${ARCH} == um ]; then
-	if [ $SUBARCH == i386 ]; then
+if [ "${ARCH}" = "um" ]; then
+	if [ "$SUBARCH" = "i386" ]; then
 		archinclude=x86
-	elif [ $SUBARCH == x86_64 ]; then
+	elif [ "$SUBARCH" = "x86_64" ]; then
 		archinclude=x86
 	else
 		archinclude=${SUBARCH}
Signature · 1 line
1.5.6.GIT