[Build-common-hackers] Bug#314341: cdbs: support dh_clean excludes with DEB_CLEAN_EXLUDES

Bastian Kleineidam Bastian Kleineidam <calvin@debian.org>, 314341@bugs.debian.org
Wed, 15 Jun 2005 22:06:16 +0200


This is a multi-part MIME message sent by reportbug.

--===============1930647719==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

Package: cdbs
Version: 0.4.30
Severity: wishlist
Tags: patch

Hi,

I needed to specify some exclude files for the dh_clean call so I
introduced a DEB_CLEAN_EXCLUDE var that handles it. It behaves like
the other DEB_*_EXCLUDE stuff only for the dh_clean command.
Attached is the patch that adds it to debhelper.mk.


Regards,
  Bastian

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.11-treasure5
Locale: LANG=de_DE@euro, LC_CTYPE=de_DE@euro (charmap=ISO-8859-15)

-- no debconf information

--===============1930647719==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="cdbs_deb_clean_exclude.diff"

--- /usr/share/cdbs/1/rules/debhelper.mk	2005-06-15 22:01:22.742221155 +0200
+++ debhelper.mk	2005-06-15 21:57:32.420055846 +0200
@@ -38,6 +38,8 @@
 # DEB_DH_ALWAYS_EXCLUDE
 #   Force builddeb to exclude files.  See the DH_ALWAYS_EXCLUDE section
 #   in debhelper(7) for more details.
+# DEB_CLEAN_EXCLUDE
+#   Shell wildcards matching files which should not be cleaned by dh_clean(1).
 # DEB_SHLIBDEPS_LIBRARY_package
 #   The name of the current library package
 # DEB_SHLIBDEPS_INCLUDE
@@ -104,11 +106,11 @@
 	fi
 
 clean::
-	dh_clean
+	dh_clean $(foreach entry,$(DEB_CLEAN_EXCLUDE),$(patsubst %,-X %,$(entry)))
 
 common-install-prehook-arch common-install-prehook-indep:: common-install-prehook-impl
 common-install-prehook-impl::
-	dh_clean -k
+	dh_clean -k $(foreach entry,$(DEB_CLEAN_EXCLUDE),$(patsubst %,-X %,$(entry)))
 	dh_installdirs -A $(DEB_INSTALL_DIRS_ALL)
 
 $(patsubst %,install/%,$(DEB_ALL_PACKAGES)) :: install/%:

--===============1930647719==--