QUILT_PATCH_DIR := $(PATCHES_DIR)
endif
+QUILT_PATCH_DIR ?= debian/patches
+QUILT_STAMPFN ?= patch
+
# Hook tg-export into quilt's make(1) snippet such that it gets executed
# before quilt patches or unpatches.
$(QUILT_STAMPFN): tg-export
| xargs grep -l '^tg:')
tg-rmdir:
# remove all files whose contents matches /^tg:/
- test -n "$(__TG_FILES)" && rm $(__TG_FILES) || :
- # remove the series file
- test -f $(QUILT_PATCH_DIR)/series && rm $(QUILT_PATCH_DIR)/series || :
+ rm -f $(__TG_FILES)
+ # remove the series file
+ rm -f $(QUILT_PATCH_DIR)/series
+ # remove dpkg v3 file
+ rm -f $(QUILT_PATCH_DIR)/.dpkg-source-applied
# 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; \