status-report-scripts parseBZbugList,1.10,1.11

Christian Iseli (c4chris) fedora-extras-commits at redhat.com
Wed Apr 19 09:58:03 UTC 2006


Author: c4chris

Update of /cvs/fedora/status-report-scripts
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv1612

Modified Files:
	parseBZbugList 
Log Message:
Implement some TODO items.


Index: parseBZbugList
===================================================================
RCS file: /cvs/fedora/status-report-scripts/parseBZbugList,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- parseBZbugList	19 Apr 2006 09:57:09 -0000	1.10
+++ parseBZbugList	19 Apr 2006 09:58:01 -0000	1.11
@@ -2,11 +2,7 @@
 # $Id$
 
 # TODO stuff
-# - read a moved-to-extra file
-# - check that packages listed in discarded file actually appear in owners
-# - check that open new/review packages do not appear in owners
-# - print what shoul dgo in the mailing list report
-# - fill the <Date> placeholder
+# - print what should go in the mailing list report
 
 use strict;
 use Getopt::Long;
@@ -16,9 +12,16 @@
 my @options = ( "help", "core=s", "extras=s", "bzid=s", "o=s", "d=s",
 		"extras_r=s" );
 
-$main::core = "http://mirrors.kernel.org/fedora/core/development/SRPMS/";
-$main::extras = "http://mirrors.kernel.org/fedora/extras/development/SRPMS/";
-$main::extras_r = "http://mirrors.kernel.org/fedora/extras/4/SRPMS/";
+$main::core
+  = "http://mirrors.kernel.org/fedora/core/development/SRPMS/";
+$main::extras
+  = "http://mirrors.kernel.org/fedora/extras/development/SRPMS/";
+$main::extras_r
+  = "http://mirrors.kernel.org/fedora/extras/4/SRPMS/";
+$main::discarded
+  = "http://fedoraproject.org/wiki/Extras/PackagesNoLongerInDevel";
+$main::bzid
+  = "http://fedoraproject.org/wiki/Extras/UsefulScripts?action=AttachFile&do=get&target=bzId_pkg.txt";
 
 if( ! GetOptions( \%opt, @options ) ) { &usage(); }
 
@@ -26,6 +29,8 @@
 $main::core = $opt{"core"} if defined $opt{"core"};
 $main::extras = $opt{"extras"} if defined $opt{"extras"};
 $main::extras_r = $opt{"extras_r"} if defined $opt{"extras_r"};
+$main::discarded = $opt{"d"} if defined $opt{"d"};
+$main::bzid = $opt{"bzid"} if defined $opt{"bzid"};
 
 &usage() if defined $opt{'help'};
 
@@ -43,7 +48,9 @@
 my %SRPMS;
 my %NAME;
 my %OWN;
+my %OWN_DUP;
 my %DISCARD;
+my %FC_INTEGRATED;
 my %PKG_LIST;
 my %BUG_LIST;
 my %OWNER_LIST;
@@ -51,9 +58,10 @@
 my %OWNER_CNT;
 my %BZOWN_CNT;
 my %BZREV_CNT;
-if (defined $opt{"bzid"}) {
+if ($main::bzid ne "") {
   local *IN;
-  open IN, $opt{"bzid"} or die "Couldn't open $opt{'bzid'} : $!";
+  open IN, "wget -nv -O - \"$main::bzid\"|"
+    or die "Failed to wget $main::bzid : $!";
   while ( <IN> ) {
     s/\s+$//;
     my @F = split /\t/;
@@ -61,11 +69,32 @@
   }
   close IN;
 }
-if (defined $opt{"d"}) {
+if ($main::discarded ne "") {
   local *IN;
-  open IN, $opt{"d"} or die "Couldn't open $opt{'d'} : $!";
+  open IN, "wget -nv -O - \"$main::discarded\"|"
+    or die "Failed to wget $main::discarded : $!";
   while ( <IN> ) {
-    s/\s+$//;
+    last if /^<p>These FE packages became integrated into a FC package/;
+  }
+  while ( <IN> ) {
+    last if /^<pre>/;
+  }
+  while ( <IN> ) {
+    last if /^<\/pre>/;
+    s/[\r\n]+$//;
+    s/\s.*$//;
+    $FC_INTEGRATED{$_} = 1;
+  }
+  while ( <IN> ) {
+    last if /^<p>These FE packages have been retired/;
+  }
+  while ( <IN> ) {
+    last if /^<pre>/;
+  }
+  while ( <IN> ) {
+    last if /^<\/pre>/;
+    s/[\r\n]+$//;
+    s/\s.*$//;
     $DISCARD{$_} = 1;
   }
   close IN;
@@ -78,10 +107,17 @@
     next if /^#/;
     s/\s+$//;
     my @F = split /\|/;
-    next if defined $DISCARD{$F[1]};
+    if (defined $DISCARD{$F[1]}) {
+      $DISCARD{$F[1]} += 1;
+      next;
+    }
     $OWN{$F[1]} = \@F;
   }
   close IN;
+  foreach my $k (keys %DISCARD) {
+    next if $DISCARD{$k} > 1;
+    print STDERR "$k is in the list of discarded pkgs, but not in owners\n";
+  }
 }
 if ($main::extras ne "") {
   &grabRepoList($main::extras, \%EXTRAS);
@@ -174,6 +210,8 @@
     }
   }
 }
+&checkOpenInOwners(\%BZR, "FE-REVIEW");
+&checkOpenInOwners(\%BZN, "FE-NEW");
 &checkOwners;
 my $fourDaysAgo = DateCalc("4 days ago", "today");
 my $fourWeeksAgo = DateCalc("4 weeks ago", "today");
@@ -189,26 +227,39 @@
 #&checkNoActivity(\%BZN, "FE-NEW");
 &countOpen(\%BZS, "FE-NEEDSPONSOR");
 &checkLowActivity(\%BZS, "FE-NEEDSPONSOR");
-print "[[TableOfContents]]\n\n= FE Package Status of <date> =\n";
+print "[[TableOfContents]]\n\n= FE Package Status of ",
+  &UnixDate("today", "%b %e, %Y"), " =\n";
 &displayOwnersWiki;
 &displayAcceptWiki(\%BZA);
 &displayNewReviewWiki(\%BZR, "FE-REVIEW");
 &displayNewReviewWiki(\%BZN, "FE-NEW");
 &displayNewReviewWiki(\%BZS, "FE-NEEDSPONSOR");
+print "----\nCategoryExtras\n";
 
 exit 0;
 
 sub checkOwners {
   my $orphan = 0;
   my $cnt = 0;
+  my @NO;
   my @NP;
   my @NP_R;
   my @NPC;
   my @OE;
+  foreach my $k (keys %EXTRAS) {
+    next if defined $OWN{$k};
+    push @NO, $k
+  }
+  if ($#NO >= 0) {
+    $COUNT_LIST{"extrasNoOwner"} = $#NO + 1;
+    $PKG_LIST{"extrasNoOwner"} = \@NO;
+  }
   for my $k (keys %OWN) {
     my $l = lc $k;
     next if $l eq $k;
     if (defined $OWN{$l}) {
+      $OWN_DUP{$l} = $OWN{$l};
+      $OWN_DUP{$k} = $OWN{$k};
       if (defined($EXTRAS{$l}) || defined($CORE{$l})) {
 	delete $OWN{$k};
 	next;
@@ -229,7 +280,7 @@
     }
     $OWNER_CNT{$$a[3]} += 1;
     unless (defined $EXTRAS{$k}) {
-      if (defined $CORE{$k}) {
+      if (defined($CORE{$k}) || defined($FC_INTEGRATED{$k})) {
 	push @NPC, $k;
       } else {
 	if (defined $EXTRAS_R{$k}) {
@@ -272,6 +323,29 @@
     print "but present in release:\n";
     &displayPkgListByOwnerWiki($a);
   }
+  if ($COUNT_LIST{"openInOwners"} > 0) {
+    print "\n\n=== Packages that have not yet completed review ===\n";
+    print "\nWe have $COUNT_LIST{'openInOwners'} packages ",
+      "which have not yet been FE_APPROVE'd...\n";
+    &displayBLWiki($BUG_LIST{"openInOwnersFE-REVIEW"}, \%BZR);
+    &displayBLWiki($BUG_LIST{"openInOwnersFE-NEW"}, \%BZN);
+  }
+  if ($COUNT_LIST{"extrasNoOwner"} > 0) {
+    print "\n\n=== Packages missing in owners.list ===\n";
+    print "\nWe have $COUNT_LIST{'extrasNoOwner'} packages present in the ",
+      "development repo which have no entry in `owners.list`:{{{\n";
+    my $p = $PKG_LIST{"extrasNoOwner"};
+    print &toLine(join(" ", @$p)), "\n";
+    print "}}}\n";
+  }
+  my @DUP = sort(keys %OWN_DUP);
+  if ($#DUP >= 0) {
+    print "\n=== Duplicated packages ===\n";
+    my $cnt = ($#DUP + 1) / 2;
+    print "\nWe have $cnt packages which appear to be duplicated:{{{\n";
+    print &toLine(join(" ", @DUP)), "\n";
+    print "}}}\n";
+  }
   $a = $PKG_LIST{"OrphanDevel"};
   print "\n=== Orphaned packages present in the development repo ===\n";
   if ($#$a >= 0) {
@@ -504,14 +578,16 @@
   print STDERR "Usage: $0 [options] <bugs list>
  where options are:
   -help           this help note
-  -bzid <file>    list associating bz ticket number with package name
+  -bzid <url>     list associating bz ticket number with package name
+                  [$main::bzid]
   -extras <url>   Fedora extras SRPMS development repo
                   [$main::extras]
   -extras_r <url> Fedora extras SRPMS release repo
                   [$main::extras_r]
   -core <url>     Fedora core SRPMS repo
                   [$main::core]
-  -d <file>       list of discarded packages
+  -d <url>        list of migrated/discarded packages
+                  [$main::discarded]
   -o <file>       owners.list file\n";
   exit 1;
 }
@@ -519,7 +595,7 @@
 sub grabRepoList {
   my ($f, $h) = @_;
   local *IN;
-  open IN, "wget -nv -O - $f|" or die "Failed to wget $f : $!";
+  open IN, "wget -nv -O - \"$f\"|" or die "Failed to wget $f : $!";
   while ( <IN> ) {
     next unless /^<img \S+ alt=.\[   \].> <a href=.([^"]+)/;
     my $file = $1;
@@ -610,3 +686,17 @@
     &displayBLWiki($BUG_LIST{"closed$cur"}, $BZ);
   }
 }
+
+sub checkOpenInOwners {
+  my ($BZ, $cur) = @_;
+  my @BL;
+  foreach my $b (sort(keys %$BZ)) {
+    my $a = $BZ->{$b};
+    next if $$a[5] eq "\"CLOSED\"";
+    next unless defined $OWN{$$a[8]};
+    delete $OWN{$$a[8]};
+    push @BL, $b;
+  }
+  $COUNT_LIST{"openInOwners"} += $#BL + 1;
+  $BUG_LIST{"openInOwners$cur"} = \@BL;
+}




More information about the scm-commits mailing list