Make "make -C test clean" idempotent
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Fri, 5 Aug 2011 12:16:47 +0000 (13:16 +0100)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Wed, 21 Sep 2011 10:25:48 +0000 (11:25 +0100)
Previously, it'd fail when done twice, because you can't rmdir a
nonexistent directory.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40004
Reviewed-by: Will Thompson <will.thompson@collabora.co.uk>
test/Makefile.am

index e5fd756..7474455 100644 (file)
@@ -272,6 +272,8 @@ clean-local:
                        REVERSEDIRS="$$D $$REVERSEDIRS" ;               \
                done ;                                                  \
                for D in $$REVERSEDIRS; do                              \
-                       rmdir $(top_builddir)/test/$$D || exit 1 ;      \
+                       rmdir $(top_builddir)/test/$$D ||               \
+                               test ! -d $(top_builddir)/test/$$D ||   \
+                               exit 1 ;        \
                done ;                                                  \
        fi