parallel-tests: save few forks when possible
authorStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 30 Apr 2012 20:18:24 +0000 (22:18 +0200)
committerStefano Lattarini <stefano.lattarini@gmail.com>
Mon, 30 Apr 2012 21:24:15 +0000 (23:24 +0200)
* lib/am/check.am (am__check_pre): Save some forks, by analyzing more
carefully the value of '$@' to decide how to extract its dirname part,
and whether that should be created as a directory.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
lib/am/check.am

index a65fef9..a48c56c 100644 (file)
@@ -185,8 +185,12 @@ $(am__sh_e_setup);                                 \
 $(am__vpath_adj_setup) $(am__vpath_adj)                        \
 $(am__tty_colors);                                     \
 srcdir=$(srcdir); export srcdir;                       \
-am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;           \
-test "x$$am__odir" = x. || $(MKDIR_P) "$$am__odir" || exit $$?;        \
+case "$@" in                                           \
+  */*) am__odir=`echo "./$@" | sed 's|/[^/]*$$||'`;;   \
+    *) am__odir=.;;                                    \
+esac;                                                  \
+test "x$$am__odir" = x"." || test -d "$$am__odir"      \
+  || $(MKDIR_P) "$$am__odir" || exit $$?;              \
 if test -f "./$$f"; then dir=./;                       \
 elif test -f "$$f"; then dir=;                         \
 else dir="$(srcdir)/"; fi;                             \