[PATCH 2/3] tests: better quoting to avoid failure with poorly-named src directory

Jim Meyering meyering at redhat.com
Thu Jul 9 17:07:01 UTC 2009


* libparted/tests/Makefile.am (init.sh): Quote, in case
$(abs_top_srcdir) contains e.g., spaces.
* tests/Makefile.am (init.sh): Likewise.
* libparted/tests/t2000-disk.sh: Better quoting here, too.
* libparted/tests/t1000-label.sh: Likewise.
Reported by Joel Granados
---
 libparted/tests/Makefile.am    |    6 +++---
 libparted/tests/t1000-label.sh |    4 ++--
 libparted/tests/t2000-disk.sh  |    4 ++--
 tests/Makefile.am              |    6 +++---
 4 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libparted/tests/Makefile.am b/libparted/tests/Makefile.am
index 197b02d..d2a7176 100644
--- a/libparted/tests/Makefile.am
+++ b/libparted/tests/Makefile.am
@@ -25,9 +25,9 @@ CLEANFILES = init.sh
 all: init.sh
 init.sh: Makefile.in
 	rm -f $@-t $@
-	echo 'PARTED_USABLE_TEST_DIR=$(PARTED_USABLE_TEST_DIR)' > $@-t
-	echo 'abs_top_srcdir=$(abs_top_srcdir)' >> $@-t
-	echo 'PATH=$(abs_builddir)$(PATH_SEPARATOR)$$PATH; export PATH' >> $@-t
+	echo 'PARTED_USABLE_TEST_DIR="$(PARTED_USABLE_TEST_DIR)"' > $@-t
+	echo 'abs_top_srcdir="$(abs_top_srcdir)"' >> $@-t
+	echo 'PATH="$(abs_builddir)$(PATH_SEPARATOR)$$PATH"; export PATH' >> $@-t
 	chmod a-w $@-t
 	mv $@-t $@

diff --git a/libparted/tests/t1000-label.sh b/libparted/tests/t1000-label.sh
index 900433f..f77919d 100755
--- a/libparted/tests/t1000-label.sh
+++ b/libparted/tests/t1000-label.sh
@@ -1,6 +1,6 @@
 #!/bin/sh

-# Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# Copyright (C) 2007-2009 Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ test_description='run the label unit tests in a directory supporting O_DIRECT'
 # in which one can open a file with the O_DIRECT flag.

 : ${top_srcdir=../..}
-. $top_srcdir/tests/test-lib.sh
+. "$top_srcdir/tests/test-lib.sh"

 test_expect_success \
     'run the actual tests' 'label'
diff --git a/libparted/tests/t2000-disk.sh b/libparted/tests/t2000-disk.sh
index ae261a9..2d074b0 100755
--- a/libparted/tests/t2000-disk.sh
+++ b/libparted/tests/t2000-disk.sh
@@ -1,6 +1,6 @@
 #!/bin/sh

-# Copyright (C) 2007-2008 Free Software Foundation, Inc.
+# Copyright (C) 2007-2009 Free Software Foundation, Inc.

 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,7 +20,7 @@ test_description='run the disk unit tests in a directory supporting O_DIRECT'
 # in which one can open a file with the O_DIRECT flag.

 : ${top_srcdir=../..}
-. $top_srcdir/tests/test-lib.sh
+. "$top_srcdir/tests/test-lib.sh"

 test_expect_success \
     'run the actual tests' 'disk'
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 7b532ff..9c17c06 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -35,9 +35,9 @@ CLEANFILES = init.sh
 all: init.sh
 init.sh: Makefile.in
 	rm -f $@-t $@
-	echo 'PARTED_USABLE_TEST_DIR=$(PARTED_USABLE_TEST_DIR)' > $@-t
-	echo 'abs_top_srcdir=$(abs_top_srcdir)' >> $@-t
-	echo 'PATH=$(parted_dir)$(sep)$(pp_dir)$(sep)$$PATH' >> $@-t
+	echo 'PARTED_USABLE_TEST_DIR="$(PARTED_USABLE_TEST_DIR)"' > $@-t
+	echo 'abs_top_srcdir="$(abs_top_srcdir)"' >> $@-t
+	echo 'PATH="$(parted_dir)$(sep)$(pp_dir)$(sep)$$PATH"' >> $@-t
 	echo 'export PATH' >> $@-t
 	chmod a-w $@-t
 	mv $@-t $@
--
1.6.3.3.524.g8586b




More information about the parted-devel mailing list