Skip to contentSkip to conversation

] m4: use test instead of []

PATCH In review Wei Liu 4 participants 4 messages Jun 2, 2020

lore
Share & tools
lore

Wei Liu

author
#0 lore raw

PATCH v2 1/1 ] m4: use test instead of []

It is reported that [] was removed by autoconf, which caused the following error:

./configure: line 4681: -z: command not found

Switch to test. That's what is used throughout our configure scripts. Also put the variable expansion in quotes.

Fixes 8a6b1665d987 ("configure: also add EXTRA_PREFIX to {CPP/LD}FLAGS")

---
v2: Address Ian's comment.

Run autogen.sh before committing.

Cc Bertrand Marquis <[email protected]>
Cc Roger Pau Monne <[email protected]>
---
 m4/set_cflags_ldflags.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
m4/set_cflags_ldflags.m4 +1 -1
index 08f5c983cc63..23706e256b42 100644
@@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
 do
     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
 done
-if [ ! -z $EXTRA_PREFIX ]; then
+if test ! -z "$EXTRA_PREFIX" ; then
     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
 fi
Signature · 1 line
2.20.1
#1 lore raw
Quoted 20 lines

-----Original Message-----
From: Wei Liu <[email protected]>
Sent: 02 June 2020 10:02
To: Xen Development List <[email protected]>
Cc: Wei Liu <[email protected]>; Bertrand Marquis <[email protected]>; Roger Pau Monne <[email protected]>; [email protected]; Ian Jackson <[email protected]>
Subject: [[PATCH v2 for-4.14]] m4: use test instead of []

It is reported that [] was removed by autoconf, which caused the following error:

./configure: line 4681: -z: command not found

Switch to test. That's what is used throughout our configure scripts. Also put the variable expansion in quotes.

Fixes 8a6b1665d987 ("configure: also add EXTRA_PREFIX to {CPP/LD}FLAGS")
Quoted 8 lines

---
v2: Address Ian's comment.

Run autogen.sh before committing.

Cc Bertrand Marquis <[email protected]>
Cc Roger Pau Monne <[email protected]>

Yes, pretty clearly wrong in the original patch.

Quoted 19 lines
---
 m4/set_cflags_ldflags.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
m4/set_cflags_ldflags.m4 +1 -2
index 08f5c983cc63..23706e256b42 100644
@@ -15,7 +15,7 @@ for ldflag in $APPEND_LIB
 do
     APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
 done
-if [ ! -z $EXTRA_PREFIX ]; then
+if test ! -z "$EXTRA_PREFIX" ; then
     CPPFLAGS="$CPPFLAGS -I$EXTRA_PREFIX/include"
     LDFLAGS="$LDFLAGS -L$EXTRA_PREFIX/lib"
 fi
--

2.20.1

Reviewed-by on v2 1/1
#2 lore raw
In reply to Wei Liu

There's a double [] enclosure in the subject

Quoted 5 lines · Wei Liu

It is reported that [] was removed by autoconf, which caused the following error:

./configure: line 4681: -z: command not found

Quoted 7 lines

Switch to test. That's what is used throughout our configure scripts. Also put the variable expansion in quotes.

Fixes 8a6b1665d987 ("configure: also add EXTRA_PREFIX to {CPP/LD}FLAGS")

There's a double SoB ;)

Thanks for taking care of this.

#3 lore raw

Roger Pau Monne writes ("Re: [[PATCH v2 for-4.14]] m4: use test instead of []"):

Quoted 11 lines

There's a double [] enclosure in the subject

Quoted 8 lines · Wei Liu

It is reported that [] was removed by autoconf, which caused the following error:

./configure: line 4681: -z: command not found

Switch to test. That's what is used throughout our configure scripts. Also put the variable expansion in quotes.

Quoted 8 lines
Quoted 4 lines
Fixes 8a6b1665d987 ("configure: also add EXTRA_PREFIX to {CPP/LD}FLAGS")

There's a double SoB ;)

Pushed, thanks.

Ian.