[Collab-qa-commits] r382 - svnbuildstat/script

goneri-guest at alioth.debian.org goneri-guest at alioth.debian.org
Mon Aug 13 21:07:17 UTC 2007


Author: goneri-guest
Date: 2007-08-13 21:07:17 +0000 (Mon, 13 Aug 2007)
New Revision: 382

Modified:
   svnbuildstat/script/svnbuildstat_update-db.pl
Log:
ignore empty changelog entry created by svn-bp after an upload
(* NOT RELEASED YET)
Very useful for the ruby extra team, 99% of the package were
concerned


Modified: svnbuildstat/script/svnbuildstat_update-db.pl
===================================================================
--- svnbuildstat/script/svnbuildstat_update-db.pl	2007-08-13 11:25:51 UTC (rev 381)
+++ svnbuildstat/script/svnbuildstat_update-db.pl	2007-08-13 21:07:17 UTC (rev 382)
@@ -110,6 +110,9 @@
   my $package = shift;
   my $cmd;
 
+  return unless $$package->svndebrelease;
+  return unless $$package->uri;
+
   $cmd = "svn cat ".$$package->uri."/debian/watch";
   my $watch = `$cmd`;
 
@@ -204,21 +207,33 @@
   }
 
   my @changelog = `svn cat $uri/debian/changelog`;
-  if (@changelog && $changelog[0] =~ /^.*\ \((.*)\)/) {
+  if (@changelog) {
 
-    $svndebrelease = $1;
 
     foreach (@changelog) {
-      last if /^\S/ && $currentchangelogentry;
+      if (/^\S/ && $currentchangelogentry) {
+	# I ignore svn-bp empty template entry
+	if ($currentchangelogentry =~ /^.*\n\s\s\*\sNOT RELEASED YET\n\n\s--.*/m) {
+	  $currentchangelogentry = '';
+	} else {
+	  last; 
+	}
+      }
       $currentchangelogentry .= $_;
-
-      # looks for bug closed in the changelog
-      my ($tmp) = $_ =~ /closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*/ig;
-      if ($tmp) {
-	$tmp =~ s/([A-Za-z]|#|:|\s)//g;
-	$currentpendingbug .= $tmp.',';
-      }
     }
+   
+    if ($currentchangelogentry =~ /^.*\ \((.*)\)/) {
+      $svndebrelease = $1; 
+      print "OK\n";
+    } else {
+      print "PAS OK\n";
+    }
+    # looks for bug closed in the changelog entry
+    # the regex come from the BTS documentation
+    foreach ($currentchangelogentry =~ /closes:\s*(?:bug)?\#\s*\d+(?:,\s*(?:bug)?\#\s*\d+)*/ig) {
+      s/([A-Za-z]|#|:|\s)//g;
+      $currentpendingbug .= $_.',' if $_;
+    }
 
   } else {
 




More information about the Collab-qa-commits mailing list