+# The leading dash is necessary for make not to die when the file is not
+# installed. TopGit is not a build dependency (and does not need to be), and
+# if the package is not installed, debian/rules can still be used normally.
+#
# The snippet exports the following targets. These targets only perform the
# describe behaviour when invoked from a TopGit repository (`tg summary -t`
# returns a non-empty set); used outside, they simply output informational
# The snippet exports the following targets. These targets only perform the
# describe behaviour when invoked from a TopGit repository (`tg summary -t`
# returns a non-empty set); used outside, they simply output informational
# tg-forceclean: cleans the source tree, just like the debian/rules clean
# target, and forcefully removes the debian/patches
# directory in doing so. Yes, *force*-fully. WHAM!
# tg-forceclean: cleans the source tree, just like the debian/rules clean
# target, and forcefully removes the debian/patches
# directory in doing so. Yes, *force*-fully. WHAM!
# the default debian/patches location.
#
# More information, particularly for people working on TopGit-using packages,
# the default debian/patches location.
#
# More information, particularly for people working on TopGit-using packages,
ifeq ($(shell tg summary -t),)
# This is not a TopGit branch, so just blubber a bit.
ifeq ($(shell tg summary -t),)
# This is not a TopGit branch, so just blubber a bit.
@echo "E: The $@ target only works from a TopGit repository." >&2
else
# We are in a TopGit branch, so let the fun begin.
@echo "E: The $@ target only works from a TopGit repository." >&2
else
# We are in a TopGit branch, so let the fun begin.
# Hook tg-export into quilt's make(1) snippet such that it gets executed
# before quilt patches or unpatches.
# Hook tg-export into quilt's make(1) snippet such that it gets executed
# before quilt patches or unpatches.
# The series file does not exist, so we proceed normally
# tg-export will not work if the target dir already exists, so try to remove
# it by calling tg-rmdir
tg-export: tg-rmdir
# The series file does not exist, so we proceed normally
# tg-export will not work if the target dir already exists, so try to remove
# it by calling tg-rmdir
tg-export: tg-rmdir
# No patch directory, so nothing to do:
tg-rmdir:
@true
else
# There is a patch directory, let's try to clean it out:
# No patch directory, so nothing to do:
tg-rmdir:
@true
else
# There is a patch directory, let's try to clean it out:
- @test ! -d $(PATCHES_DIR) || { \
- echo "E: $(PATCHES_DIR) contains non-TopGit-generated files:" >&2; \
- find $(PATCHES_DIR) -type f -printf 'E: %P\n' >&2; \
+ @test ! -d $(QUILT_PATCH_DIR) || { \
+ echo "E: $(QUILT_PATCH_DIR) contains non-TopGit-generated files:" >&2; \
+ find $(QUILT_PATCH_DIR) -type f -printf 'E: %P\n' >&2; \