chiark / gitweb /
make removing quilt patches dir more robust
[topgit.git] / debian / tg2quilt.mk
index 2ff9bc9a754f7cc051143ef3952cecdc8caf7534..4ec27e27e12028fcd1a14aba4e951b0659e5b2fb 100644 (file)
@@ -68,8 +68,10 @@ else
 
 # We are in a TopGit branch, so let the fun begin.
 
-ifdef (PATCHES_DIR)
-       @echo 'W: The $PATCHES_DIR variable is deprecated, please use $QUILT_PATCH_DIR instead' >&2
+ifdef PATCHES_DIR
+       DUMMY := $(warning W: The $$PATCHES_DIR variable is deprecated, please use $$QUILT_PATCH_DIR instead.)
+       DUMMY := $(warning W: Sleeping for 10 seconds so you can read this!)
+       DUMMY := $(shell sleep 10)
        QUILT_PATCH_DIR := $(PATCHES_DIR)
 endif
 
@@ -120,7 +122,7 @@ else
         # remove the series file
        test -f $(QUILT_PATCH_DIR)/series && rm $(QUILT_PATCH_DIR)/series || :
        # try to remove directories
-       find $(QUILT_PATCH_DIR) -type d | tac | xargs rmdir 2>/dev/null || :
+       find $(QUILT_PATCH_DIR) -depth -type d -empty -execdir rmdir {} +
        # fail if the directory could not be removed and still exists
        @test ! -d $(QUILT_PATCH_DIR) || { \
          echo "E: $(QUILT_PATCH_DIR) contains non-TopGit-generated files:" >&2; \