[debhelper-devel] [debhelper] 03/05: Dh_Lib: let compat with nowarn survive missing compat

Niels Thykier nthykier at moszumanska.debian.org
Tue Apr 5 18:49:00 UTC 2016


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

nthykier pushed a commit to branch master
in repository debhelper.

commit 5da632b8c068feebab5b6a225023764d81735f3e
Author: Niels Thykier <niels at thykier.net>
Date:   Tue Apr 5 18:46:20 2016 +0000

    Dh_Lib: let compat with nowarn survive missing compat
    
    That way dh --help and dh --list works again without a d/compat.
    
    Signed-off-by: Niels Thykier <niels at thykier.net>
---
 Debian/Debhelper/Dh_Lib.pm | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)

diff --git a/Debian/Debhelper/Dh_Lib.pm b/Debian/Debhelper/Dh_Lib.pm
index ca25378..5ba2102 100644
--- a/Debian/Debhelper/Dh_Lib.pm
+++ b/Debian/Debhelper/Dh_Lib.pm
@@ -427,8 +427,8 @@ sub dirname {
 					}
 				}
 			}
-			else {
-				warning("No compatibility level specified in debian/compat");
+			elsif (not $nowarn) {
+				warning("No! compatibility level specified in debian/compat");
 				warning("This package will soon FTBFS; time to fix it!");
 			}
 
@@ -436,17 +436,19 @@ sub dirname {
 				$c=$ENV{DH_COMPAT};
 			}
 		}
-		if ($c < MIN_COMPAT_LEVEL) {
-			error("Compatibility levels before ${\MIN_COMPAT_LEVEL} are no longer supported (level $c requested)");
-		}
+		if (not $nowarn) {
+			if ($c < MIN_COMPAT_LEVEL) {
+				error("Compatibility levels before ${\MIN_COMPAT_LEVEL} are no longer supported (level $c requested)");
+			}
 
-		if ($c < LOWEST_NON_DEPRECATED_COMPAT_LEVEL && ! $warned_compat && ! $nowarn) {
-			warning("Compatibility levels before ${\LOWEST_NON_DEPRECATED_COMPAT_LEVEL} are deprecated (level $c in use)");
-			$warned_compat=1;
-		}
+			if ($c < LOWEST_NON_DEPRECATED_COMPAT_LEVEL && ! $warned_compat) {
+				warning("Compatibility levels before ${\LOWEST_NON_DEPRECATED_COMPAT_LEVEL} are deprecated (level $c in use)");
+				$warned_compat=1;
+			}
 	
-		if ($c > MAX_COMPAT_LEVEL) {
-			error("Sorry, but ${\MAX_COMPAT_LEVEL} is the highest compatibility level supported by this debhelper.");
+			if ($c > MAX_COMPAT_LEVEL) {
+				error("Sorry, but ${\MAX_COMPAT_LEVEL} is the highest compatibility level supported by this debhelper.");
+			}
 		}
 
 		return ($c <= $num);

-- 
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