mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] liblockdep: Fix unsupported 'basename -s' in run_tests.sh
@ 2016-03-30  8:22 Sedat Dilek
  2016-03-30 10:51 ` [tip:core/urgent] tools/lib/lockdep: " tip-bot for Sedat Dilek
  0 siblings, 1 reply; 2+ messages in thread
From: Sedat Dilek @ 2016-03-30  8:22 UTC (permalink / raw)
  Cc: Sedat Dilek, Sasha Levin, Linus Torvalds, Ingo Molnar,
	Theodore Ts'o, Boqun Feng, LKML, linux-fsdevel

Here on Ubuntu/precise I have GNU/coreutils v8.13 installed
where 'basename -s' is not supported.

The result is that run_tests.sh is not done properly.

[ INSTRUCTIONS ]

$ cd $BUILD_DIR
$ LC_ALL=C make -C tools/ liblockdep
$ cd tools/lib/lockdep/

$ LC_ALL=C ./run_tests.sh
basename: invalid option -- 's'
Try `basename --help' for more information.
... timeout: failed to run command `./tests/': Permission denied
FAILED!
rm: cannot remove `tests/': Is a directory

Due to unsupported basename the tests programs are not generated
and cannot be removed.

Fix this by doing a compatible basename invocation and check for
the existence of generated tests programs.

For more details see the thread in [1] on LKML.

This patch is on top of Linux v4.6-rc1.

[1] http://marc.info/?t=145906667300001&r=1&w=2

Cc: Sasha Levin <sasha.levin@oracle.com> (maintainer:LIBLOCKDEP)
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Theodore Ts'o <tytso@mit.edu>
Cc: Boqun Feng <boqun.feng@gmail.com> 
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: linux-fsdevel <linux-fsdevel@vger.kernel.org>
Signed-off-by: Sedat Dilek <sedat.dilek@gmail.com>
---
 tools/lib/lockdep/run_tests.sh | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/tools/lib/lockdep/run_tests.sh b/tools/lib/lockdep/run_tests.sh
index 5334ad9d39b7..1069d96248c1 100755
--- a/tools/lib/lockdep/run_tests.sh
+++ b/tools/lib/lockdep/run_tests.sh
@@ -3,7 +3,7 @@
 make &> /dev/null
 
 for i in `ls tests/*.c`; do
-	testname=$(basename -s .c "$i")
+	testname=$(basename "$i" .c)
 	gcc -o tests/$testname -pthread -lpthread $i liblockdep.a -Iinclude -D__USE_LIBLOCKDEP &> /dev/null
 	echo -ne "$testname... "
 	if [ $(timeout 1 ./tests/$testname | wc -l) -gt 0 ]; then
@@ -11,11 +11,13 @@ for i in `ls tests/*.c`; do
 	else
 		echo "FAILED!"
 	fi
-	rm tests/$testname
+	if [ -f "tests/$testname" ]; then
+		rm tests/$testname
+	fi
 done
 
 for i in `ls tests/*.c`; do
-	testname=$(basename -s .c "$i")
+	testname=$(basename "$i" .c)
 	gcc -o tests/$testname -pthread -lpthread -Iinclude $i &> /dev/null
 	echo -ne "(PRELOAD) $testname... "
 	if [ $(timeout 1 ./lockdep ./tests/$testname | wc -l) -gt 0 ]; then
@@ -23,5 +25,7 @@ for i in `ls tests/*.c`; do
 	else
 		echo "FAILED!"
 	fi
-	rm tests/$testname
+	if [ -f "tests/$testname" ]; then
+		rm tests/$testname
+	fi
 done
-- 
2.8.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-30 10:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-30  8:22 [PATCH] liblockdep: Fix unsupported 'basename -s' in run_tests.sh Sedat Dilek
2016-03-30 10:51 ` [tip:core/urgent] tools/lib/lockdep: " tip-bot for Sedat Dilek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome