Skip to contentSkip to conversation

Make test for gnuplot work with empty strings.

PATCH In review Martin Steigerwald 3 participants 9 messages Mar 11, 2013 – Aug 5, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Make test for gnuplot work with empty strings.

When I launch fio_generate_plots on a system where gnuplot is not installed I get this error :

$ fio_generate_plots test
Making bw logs
/usr/bin/fio_generate_plots: 42: /usr/bin/fio_generate_plots: -: not found

That's because the test checking whether gnuplot is installed is failing because of an empty variable :
GNUPLOT=$(which gnuplot)
if [ ! -x $GNUPLOT ]; then
echo You need gnuplot installed to generate graphs exit 1
fi

Indeed the command "test -x" is exiting with code 0.

To correct this we should enclose the variable with quotes :
if [ ! -x "$GNUPLOT" ]; then

Then the script is going into the test properly :

$ fio_generate_plots test
You need gnuplot installed to generate graphs

I copied problem description by Hervé from the Debian bug report below.

Fixes:
Bug#700580: /usr/bin/fio_generate_plots: -: not found
http://bugs.debian.org/700580

---
 fio_generate_plots |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fio_generate_plots +1 -1
index 4285415..5e2febd 100755
@@ -8,7 +8,7 @@ if [ "$1"x = "x" ]; then
 fi
 
 GNUPLOT=$(which gnuplot)
-if [ ! -x $GNUPLOT ]; then
+if [ ! -x "$GNUPLOT" ]; then
 	echo You need gnuplot installed to generate graphs
 	exit 1
 fi
Signature · 1 line
1.7.10.4
#1 lore raw
Quoted 42 lines · Martin Steigerwald

When I launch fio_generate_plots on a system where gnuplot is not installed I get this error :

$ fio_generate_plots test
Making bw logs
/usr/bin/fio_generate_plots: 42: /usr/bin/fio_generate_plots: -: not found

That's because the test checking whether gnuplot is installed is failing because of an empty variable :
GNUPLOT=$(which gnuplot)
if [ ! -x $GNUPLOT ]; then
echo You need gnuplot installed to generate graphs exit 1
fi

Indeed the command "test -x" is exiting with code 0.

To correct this we should enclose the variable with quotes :
if [ ! -x "$GNUPLOT" ]; then

Then the script is going into the test properly :

$ fio_generate_plots test
You need gnuplot installed to generate graphs

I copied problem description by Herv� from the Debian bug report below.

Fixes:
Bug#700580: /usr/bin/fio_generate_plots: -: not found
http://bugs.debian.org/700580

---
 fio_generate_plots |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fio_generate_plots +0 -0
index 4285415..5e2febd 100755

fio_generate_plots if [ "$1"x = "x" ]; then · line 14

Quoted 8 lines
fio_generate_plots +1 -1
@@ -8,7 +8,7 @@ if [ "$1"x = "x" ]; then
 fi
 
 GNUPLOT=$(which gnuplot)
-if [ ! -x $GNUPLOT ]; then
+if [ ! -x "$GNUPLOT" ]; then
 	echo You need gnuplot installed to generate graphs
 	exit 1
 fi

Thanks, obviously correct :-)

Signature · 1 line
Jens Axboe
#2 lore raw

----- Ursprüngliche Mail -----

Quoted 46 lines · Martin Steigerwald
Quoted 45 lines

When I launch fio_generate_plots on a system where gnuplot is not installed I
get this error :

$ fio_generate_plots test
Making bw logs
/usr/bin/fio_generate_plots: 42: /usr/bin/fio_generate_plots: -: not found

That's because the test checking whether gnuplot is installed is failing because of an empty variable :
GNUPLOT=$(which gnuplot)
if [ ! -x $GNUPLOT ]; then
echo You need gnuplot installed to generate graphs exit 1
fi

Indeed the command "test -x" is exiting with code 0.

To correct this we should enclose the variable with quotes :
if [ ! -x "$GNUPLOT" ]; then

Then the script is going into the test properly :

$ fio_generate_plots test
You need gnuplot installed to generate graphs

I copied problem description by Hervé from the Debian bug report below.

Fixes:
Bug#700580: /usr/bin/fio_generate_plots: -: not found
http://bugs.debian.org/700580

---
 fio_generate_plots |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fio_generate_plots +0 -0
index 4285415..5e2febd 100755
@@ -8,7 +8,7 @@ if [ "$1"x = "x" ]; then
 fi
 
Quoted 8 lines

fio_generate_plots if [ "$1"x = "x" ]; then · line 14

Quoted 6 lines
fio_generate_plots +1 -1
 GNUPLOT=$(which gnuplot)
-if [ ! -x $GNUPLOT ]; then
+if [ ! -x "$GNUPLOT" ]; then
 	echo You need gnuplot installed to generate graphs
 	exit 1
 fi

Thanks, obviously correct :-)

Still it doesn't seem you applied it as of

428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5ESC

of git://git.kernel.dk/fio.git

Fixing locally in Debian package now.

Thaqnks,

Signature · 2 lines
Martin Steigerwald - teamix GmbH - http://www.teamix.de
gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
#3 lore raw
Quoted 1 line · Martin Steigerwald

Still it doesn't seem you applied it as of 428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5ESC of git://git.kernel.dk/fio.git Fixing locally in Debian package now. Thaqnks,

Jens,

I've been putting this patch to my erwan/fixes branch I asked about merging.

That's commit 4e074cd1ad6a804ae646d52523e2dda69bbcabba assigned to "Author: Martin Steigerwald "<[email protected]>

Cheers,
Erwan,

#4 lore raw

Dropped bug report from Cc.

----- Ursprüngliche Mail -----

Quoted 6 lines · Martin Steigerwald
Quoted 4 lines

Still it doesn't seem you applied it as of 428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5ESC of
git://git.kernel.dk/fio.git Fixing locally in Debian package now. Thaqnks,

Quoted 6 lines

Jens,

I've been putting this patch to my erwan/fixes branch I asked about merging.

That's commit 4e074cd1ad6a804ae646d52523e2dda69bbcabba assigned to "Author: Martin Steigerwald "<[email protected]>

Thanks, Erwan.

Jens, any plans for a fio 2.12 release?

Anyway, I already submitted 2.11 as request for sponsorship with the bug fixed in package.

Ciao,

Signature · 2 lines
Martin Steigerwald - teamix GmbH - http://www.teamix.de
gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
#5 lore raw

On 05/08/2013 17:07, Martin Steigerwald wrote:

[...]

Quoted 7 lines

Thanks, Erwan.

Jens, any plans for a fio 2.12 release?

Anyway, I already submitted 2.11 as request for sponsorship with the bug fixed in package.

Ciao,

So I've been removing mine since Jens already did it :p

Cheers,

#6 lore raw
In reply to Martin Steigerwald
Quoted 11 lines · Martin Steigerwald

Dropped bug report from Cc.

----- Urspr�ngliche Mail -----

Quoted 8 lines · Martin Steigerwald
Quoted 4 lines

Still it doesn't seem you applied it as of 428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5ESC of
git://git.kernel.dk/fio.git Fixing locally in Debian package now. Thaqnks,

Jens,

Quoted 8 lines
Quoted 4 lines

I've been putting this patch to my erwan/fixes branch I asked about merging.

That's commit 4e074cd1ad6a804ae646d52523e2dda69bbcabba assigned to "Author: Martin Steigerwald "<[email protected]>

Thanks, Erwan.

Jens, any plans for a fio 2.12 release?

Yes, will be there soon. I just need to fully verify some recent changes, then it can be tagged and "shipped". Sometime this week.

Signature · 1 line
Jens Axboe
#7 lore raw

----- Ursprüngliche Mail -----

Quoted 18 lines · Martin Steigerwald
Quoted 17 lines

Dropped bug report from Cc.

----- Ursprüngliche Mail -----

Quoted 13 lines · Martin Steigerwald
Quoted 4 lines

Still it doesn't seem you applied it as of 428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5ESC of
git://git.kernel.dk/fio.git Fixing locally in Debian package now. Thaqnks,

Jens,

I've been putting this patch to my erwan/fixes branch I asked about merging.

That's commit 4e074cd1ad6a804ae646d52523e2dda69bbcabba assigned to "Author: Martin Steigerwald "<[email protected]>

Quoted 6 lines
Quoted 3 lines

Thanks, Erwan.

Jens, any plans for a fio 2.12 release?

Yes, will be there soon. I just need to fully verify some recent changes, then it can be tagged and "shipped". Sometime this week.

Well if it comes before someone responds to RFS, I just update the RFS once again. :)

Ciao,

Signature · 2 lines
Martin Steigerwald - teamix GmbH - http://www.teamix.de
gpg: 19E3 8D42 896F D004 08AC A0CA 1E10 C593 0399 AE90
#8 lore raw
In reply to Martin Steigerwald
Quoted 56 lines · Martin Steigerwald

----- Ursprüngliche Mail -----

Quoted 46 lines · Martin Steigerwald
Quoted 45 lines

When I launch fio_generate_plots on a system where gnuplot is not installed I
get this error :

$ fio_generate_plots test
Making bw logs
/usr/bin/fio_generate_plots: 42: /usr/bin/fio_generate_plots: -: not found

That's because the test checking whether gnuplot is installed is failing because of an empty variable :
GNUPLOT=$(which gnuplot)
if [ ! -x $GNUPLOT ]; then
echo You need gnuplot installed to generate graphs exit 1
fi

Indeed the command "test -x" is exiting with code 0.

To correct this we should enclose the variable with quotes :
if [ ! -x "$GNUPLOT" ]; then

Then the script is going into the test properly :

$ fio_generate_plots test
You need gnuplot installed to generate graphs

I copied problem description by Hervé from the Debian bug report below.

Fixes:
Bug#700580: /usr/bin/fio_generate_plots: -: not found
http://bugs.debian.org/700580

---
 fio_generate_plots |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fio_generate_plots +0 -0
index 4285415..5e2febd 100755
@@ -8,7 +8,7 @@ if [ "$1"x = "x" ]; then
 fi
 
Quoted 8 lines

fio_generate_plots if [ "$1"x = "x" ]; then · line 14

Quoted 6 lines
fio_generate_plots +1 -1
 GNUPLOT=$(which gnuplot)
-if [ ! -x $GNUPLOT ]; then
+if [ ! -x "$GNUPLOT" ]; then
 	echo You need gnuplot installed to generate graphs
 	exit 1
 fi

Thanks, obviously correct :-)

Quoted 7 lines

Still it doesn't seem you applied it as of

428b4f6ba681dbb40c8e2213d0c6ae8f8049dcd5ESC

of git://git.kernel.dk/fio.git

Fixing locally in Debian package now.

Weird, I must have done it on the old workstation (that is still in transit) and forgot to push it out. Rectified now!

Signature · 1 line
Jens Axboe