chiark / gitweb /
Deprecate tg2quilt.mk's $PATCHES_DIR variable
authormartin f. krafft <madduck@debian.org>
Sun, 1 Mar 2009 11:25:59 +0000 (12:25 +0100)
committermartin f. krafft <madduck@debian.org>
Sun, 1 Mar 2009 11:25:59 +0000 (12:25 +0100)
put a warning in place to point people to $QUILT_PATCH_DIR instead.

debian/changelog
debian/tg2quilt.mk

index 19e2d170b68a97d4c9eb14d6dd5f922b21ec7747..919924cfacd24bdae6c120b9228b20b8d8b9d668 100644 (file)
@@ -8,6 +8,8 @@ topgit (0.5-2) unstable; urgency=low
     tg2quilt.mk, to avoid the topgit build-dependency.
   * Suggest the quilt package.
   * Fix GPL version in copyright file (closes: #514157).
+  * Deprecate tg2quilt.mk's $PATCHES_DIR variable and put a warning in place
+    to point people to $QUILT_PATCH_DIR instead.
 
  -- martin f. krafft <madduck@debian.org>  Wed, 19 Nov 2008 17:58:45 +0100
 
index a0f8d587bf2531461dcd308f7e3795494bec23a8..2ff9bc9a754f7cc051143ef3952cecdc8caf7534 100644 (file)
@@ -49,7 +49,7 @@
 # that tg-export is automatically invoked before quilt gets a chance to patch
 # or unpatch the tree.
 #
-# The PATCHES_DIR variable can be set before including the file to override
+# The QUILT_PATCH_DIR variable can be set before including the file to override
 # the default debian/patches location.
 #
 # More information, particularly for people working on TopGit-using packages,
@@ -68,7 +68,10 @@ else
 
 # We are in a TopGit branch, so let the fun begin.
 
-PATCHES_DIR ?= $(QUILT_PATCH_DIR)
+ifdef (PATCHES_DIR)
+       @echo 'W: The $PATCHES_DIR variable is deprecated, please use $QUILT_PATCH_DIR instead' >&2
+       QUILT_PATCH_DIR := $(PATCHES_DIR)
+endif
 
 # Hook tg-export into quilt's make(1) snippet such that it gets executed
 # before quilt patches or unpatches.
@@ -87,13 +90,13 @@ tg-export: __TG_COMMA := ,
 tg-export: __TG_EMPTY :=
 tg-export: __TG_SPACE := $(__TG_EMPTY) $(__TG_EMPTY)
 
-ifeq ($(wildcard $(PATCHES_DIR)/series),)
+ifeq ($(wildcard $(QUILT_PATCH_DIR)/series),)
   # 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
-       tg export -b $(subst $(__TG_SPACE),$(__TG_COMMA),$(TG_BRANCHES)) --quilt $(PATCHES_DIR)
+       tg export -b $(subst $(__TG_SPACE),$(__TG_COMMA),$(TG_BRANCHES)) --quilt $(QUILT_PATCH_DIR)
 else
   # The series file already exists, so assume there is nothing to do.
   tg-export:
@@ -102,26 +105,26 @@ else
        @echo "I: (you can ignore this message during a \`tg-clean\` run.)" >&2
 endif
 
-ifeq ($(wildcard $(PATCHES_DIR)),)
+ifeq ($(wildcard $(QUILT_PATCH_DIR)),)
   # No patch directory, so nothing to do:
   tg-rmdir:
        @true
 
 else
   # There is a patch directory, let's try to clean it out:
-  tg-rmdir: __TG_FILES := $(shell find $(PATCHES_DIR) -type f -a -not -path \*/series \
+  tg-rmdir: __TG_FILES := $(shell find $(QUILT_PATCH_DIR) -type f -a -not -path \*/series \
                                     | 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 $(PATCHES_DIR)/series && rm $(PATCHES_DIR)/series || :
+       test -f $(QUILT_PATCH_DIR)/series && rm $(QUILT_PATCH_DIR)/series || :
        # try to remove directories
-       find $(PATCHES_DIR) -type d | tac | xargs rmdir 2>/dev/null || :
+       find $(QUILT_PATCH_DIR) -type d | tac | xargs rmdir 2>/dev/null || :
        # fail if the directory could not be removed and still exists
-       @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; \
          false; \
        }
 endif
@@ -131,7 +134,7 @@ tg-clean: clean
        $(MAKE) --no-print-directory -f debian/rules tg-rmdir
 
 tg-forceclean: clean
-       test -d $(PATCHES_DIR) && rm -r $(PATCHES_DIR) || :
+       test -d $(QUILT_PATCH_DIR) && rm -r $(QUILT_PATCH_DIR) || :
 
 tg-cleanexport: tg-rmdir
        $(MAKE) --no-print-directory -f debian/rules tg-export