[debhelper-devel] [debhelper] 01/02: dh_clean: Work around for cdbs d/compat auto-vivification

Niels Thykier nthykier at moszumanska.debian.org
Tue Nov 17 20:34:35 UTC 2015


This is an automated email from the git hooks/post-receive script.

nthykier pushed a commit to branch master
in repository debhelper.

commit 3c25542464e9c949917c921a67dbda32d55e904c
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Nov 17 21:26:30 2015 +0100

    dh_clean: Work around for cdbs d/compat auto-vivification
    
    cdbs has a feature where it will create debian/compat and set its
    contents to 5 if it does not exist (and DH_COMPAT does not exist).
    
    The issue being builds generally call "clean" before "build" and as
    such packages relying on this feature now FTBFS.  As they were not
    listed as packages in danger (lintian considered them to have compat 5
    or greater), we now instate this work around to cater for them.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 debian/changelog |  7 +++++++
 dh_clean         | 11 +++++++++++
 2 files changed, 18 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 9d36bb7..e95487c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,12 @@
 debhelper (9.20151117) UNRELEASED; urgency=medium
 
+  [ Niels Thykier ]
+  * dh_clean: Temporarily interpret the absence of d/compat and
+    DH_COMPAT to mean compat 5.  This is to avoid breaking
+    packages that rely on cdbs to set debian/compat to 5 during
+    the build.  This temporary work around will live until
+    d/compat becomes mandatory.  (Closes: #805404)
+
   [ Translations ]
   * Update German translation (Chris Leick)
     (Closes: #802198)
diff --git a/dh_clean b/dh_clean
index 042d8ef..38dc04a 100755
--- a/dh_clean
+++ b/dh_clean
@@ -72,6 +72,17 @@ slash.  Any content in these directories will be removed as well.
 
 =cut
 
+if ( not -f 'debian/compat' and not $ENV{'DH_COMPAT'}) {
+	# Temporary work around - Permit a missing compat to work with
+	# cdbs's feature of auto-creating a d/compat file.
+	#  - Auto-bump to compat 5 to match cdbs (Not that it matters a lot,
+	#    since there is no compat conditions for 4 or less)
+	warning("Pretending DH_COMPAT was set to 5");
+	warning(" - this is a temporary measure to avoid FTBFS in packages");
+	warning("   relying on cdbs to set debian/compat to 5 during the build");
+	$ENV{'DH_COMPAT'} = 5;
+}
+
 init(options => {
 	"dirs-only" => \$dh{D_FLAG},
 });

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debhelper/debhelper.git




More information about the debhelper-devel mailing list