[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[SCM] Debian package checker branch, master, updated. 2.5.3-241-g457459e



The following commit has been merged in the master branch:
commit 9128e07bc3f00eda3e407593ae3e7a7ca3886e7e
Author: Niels Thykier <niels@thykier.net>
Date:   Mon Nov 21 23:33:31 2011 +0100

    changelog-format: Cope with multi-line "release headers"
    
    Signed-off-by: Niels Thykier <niels@thykier.net>

diff --git a/t/scripts/changelog-format.t b/t/scripts/changelog-format.t
index 6c85cf8..ab18a80 100755
--- a/t/scripts/changelog-format.t
+++ b/t/scripts/changelog-format.t
@@ -32,6 +32,7 @@ plan skip_all => 'Only valid for regular Debian releases'
 my $changes = $changelog->dpkg()->{'Changes'};
 my $line = 0;
 my $prev_head = '';
+my $release_header = 0;
 
 foreach (split /\n/,$changes) {
     # Parse::DebianChangelog adds an empty line at the beginning:
@@ -41,6 +42,11 @@ foreach (split /\n/,$changes) {
     s/^ //;
     $line++;
 
+    if (m/^\s*$/o) {
+        $release_header = 0;
+        next;
+    }
+
     my $spaces = 0;
     $spaces++ while (s/^\s//);
 
@@ -61,9 +67,15 @@ foreach (split /\n/,$changes) {
 	} elsif ($line == 3) {
 	    ok(m/^[A-Z]/, 'line is the release header')
 		or diag("line: $line");
+            $release_header = 1;
 	} else {
-	    fail('line is a bullet list item');
-	    diag("line: $line");
+            # Unless this is a multi-line release header, it should
+            # have been a bullet list.  Also limit the length of the
+            # release header.
+            unless ($release_header && $line < 7) {
+                fail('line is a bullet list item');
+                diag("line: $line");
+            }
 	}
     } elsif ($spaces == 4) {
 	ok(m/^\+/, 'line is a sub-item of a bullet-list item')
@@ -80,7 +92,7 @@ foreach (split /\n/,$changes) {
 	ok($prev_head eq '-', 'line is a continuation of tag change')
 	    or diag("line: $line");
     } else {
-	ok(m/^(:?\.|lintian.+)$/, 'line is either empty, or entry header')
+	ok(m/^(:?\.|lintian.+)$/, 'line is an entry header')
 	    or diag("line: $line");
     }
 

-- 
Debian package checker


Reply to: