]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
ensure there is a blank line before a changes entry and a release marker
authorMark Andrews <marka@isc.org>
Wed, 23 May 2018 04:31:15 +0000 (14:31 +1000)
committerEvan Hunt <each@isc.org>
Thu, 24 May 2018 00:59:05 +0000 (17:59 -0700)
(cherry picked from commit c91770549f86f36f62dbbaef43e7a529ff9ae8aa)
(cherry picked from commit d87eb5804dee423ccb3984462a6df4b78feb9ec1)

util/check-changes

index e401c0b2aefe54d47d1e08c7f5188cefc85e4f38..be506aefefd1ed262a2eab621ac741076ed604fb 100644 (file)
@@ -29,11 +29,11 @@ $\ = "\n";          # set output record separator
 
 $change = 0;
 $status = 0;
+$wasblank = 1;
 
 line: while (<>) {
     ($Fld1,$Fld2,$Fld3,$Fld4) = split(' ', $_, 9999);
-    $change = 0 if (!$master && $Fld1 eq "---" &&
-                   $Fld3 eq "released" && $Fld4 eq "---");
+    $change = 0 if (!$master && /^\s+--- .* ---$/);
     if ($Fld1 =~ /^[1-9][0-9]*\.$/ && $Fld2 =~ /^\[.*\]$/) {
        if ($change != 0 && $Fld1 >= $change) {
            print 'bad change number', $Fld1;
@@ -44,6 +44,21 @@ line: while (<>) {
            $status = 1;
        }
        $change = $Fld1;
+       if (!$wasblank) {
+           print 'missing blank line before change', $Fld1;
+           $status = 1;
+       }
+    }
+    if (/^\s+--- .* ---$/) {
+       if (!$wasblank) {
+           print 'missing blank line before release marker for', $Fld2;
+           $status = 1;
+       }
+    }
+    if ($Fld1 eq "") {
+       $wasblank = 1;
+    } else {
+       $wasblank = 0;
     }
 }