Subject: [PATCH] Reorganise the code so that all the compat-related stuff is together

From: Raphael Geissert <[email-masked]>
Date: Sat, 31 Jan 2009 18:57:48 -0600

Signed-off-by: Raphael Geissert <[email-masked]>
---
 checks/debhelper |   45 +++++++++++++++++++++++----------------------
 1 files changed, 23 insertions(+), 22 deletions(-)

diff --git a/checks/debhelper b/checks/debhelper
index f761c30..963cbcd 100644
--- a/checks/debhelper
+++ b/checks/debhelper
@@ -198,6 +198,29 @@ if ($needversiondepends !~ m/^\d+$/ and not $compatnan) {
     $compatnan = 1;
 }
 
+if ($usescdbs and not $needversiondepends) {
+    $needversiondepends = $cdbscompat;
+}
+$needversiondepends ||= 1;
+if ($needversiondepends < 4) {
+    tag "package-uses-deprecated-debhelper-compat-version", $needversiondepends;
+} elsif ($needversiondepends > 5 and ! Dep::implies($bdepends, Dep::parse("debhelper (>= $needversiondepends)"))) {
+    tag "package-lacks-versioned-build-depends-on-debhelper", $needversiondepends;
+} elsif (@versioncheck) {
+    my %seen;
+    @versioncheck = grep { !$seen{$_}++ } @versioncheck;
+    for my $program (@versioncheck) {
+        my $required = $versions{$program};
+        tag 'debhelper-script-needs-versioned-build-depends', $program, "(>= $required)"
+            unless Dep::implies($bdepends, Dep::parse("debhelper (>= $required)"));
+    }
+}
+
+if ($seendhcleank and $compat >= 7) {
+    tag "dh-clean-k-is-deprecated";
+}
+
+
 # Check the files in the debian directory for various debhelper-related
 # things.
 my $bdepends;
@@ -289,28 +312,6 @@ if ($seendhpython && !$usescdbspython) {
     }
 }
 
-if ($usescdbs and not $needversiondepends) {
-    $needversiondepends = $cdbscompat;
-}
-$needversiondepends ||= 1;
-if ($needversiondepends < 4) {
-    tag "package-uses-deprecated-debhelper-compat-version", $needversiondepends;
-} elsif ($needversiondepends > 5 and ! Dep::implies($bdepends, Dep::parse("debhelper (>= $needversiondepends)"))) {
-    tag "package-lacks-versioned-build-depends-on-debhelper", $needversiondepends;
-} elsif (@versioncheck) {
-    my %seen;
-    @versioncheck = grep { !$seen{$_}++ } @versioncheck;
-    for my $program (@versioncheck) {
-        my $required = $versions{$program};
-        tag 'debhelper-script-needs-versioned-build-depends', $program, "(>= $required)"
-            unless Dep::implies($bdepends, Dep::parse("debhelper (>= $required)"));
-    }
-}
-
-if ($seendhcleank and $compat >= 7) {
-    tag "dh-clean-k-is-deprecated";
-}
-
 }
 
 1;