[Collab-qa-commits] r642 - bapase

lucas at alioth.debian.org lucas at alioth.debian.org
Tue Jan 15 08:08:47 UTC 2008


Author: lucas
Date: 2008-01-15 08:08:46 +0000 (Tue, 15 Jan 2008)
New Revision: 642

Modified:
   bapase/datafiles.rb
   bapase/gen_html.rb
   bapase/html.rb
Log:
add scores-nmued.html, targetting all the packages that are maintained with NMUs.


Modified: bapase/datafiles.rb
===================================================================
--- bapase/datafiles.rb	2008-01-13 22:28:11 UTC (rev 641)
+++ bapase/datafiles.rb	2008-01-15 08:08:46 UTC (rev 642)
@@ -22,6 +22,27 @@
   return [srcpkg, pkgs]
 end
 
+def read_nmus
+  nmus = {}
+  Dir::glob('unstable-*-Sources') do |s|
+    src = nil
+    IO::read(s).each_line do |l|
+      if l =~ /^Package:/
+        src = l.split(' ')[1].chomp
+      elsif l =~ /^Version:/
+        ver = l.split(' ')[1].chomp
+        if ver =~ /-/
+          if ver =~ /\.(\d+)$/
+            nmus[src] = $1.to_i
+          end
+        end
+      end
+    end
+  end
+  return nmus
+end
+
+
 class TestingStatus
   attr_accessor :testingversion, :unstableversion, :firstinunstable, :testingdays, :intesting, :syncdays, :sync, :syncversion
 end

Modified: bapase/gen_html.rb
===================================================================
--- bapase/gen_html.rb	2008-01-13 22:28:11 UTC (rev 641)
+++ bapase/gen_html.rb	2008-01-15 08:08:46 UTC (rev 642)
@@ -14,6 +14,7 @@
 
 $testing = read_testing
 $srcpkg, $pkgs = read_sources
+$nmus = read_nmus
 $popcon = read_popcon
 $rcbugs, $bugs = read_bugs
 $wnpp = read_wnpp
@@ -69,7 +70,62 @@
 f = File::new('scores-buggy.html', 'w')
 gen_html($score, f)
 f.close
+#
+######## -NMUed
+$score = {}
+$pkgs.keys.each do |pkg|
+  score = 0
+  next if not $nmus[pkg]
+  score += $nmus[pkg] * 750
 
+  if $testing[pkg]
+    ts = $testing[pkg]
+    score += ts.testingdays
+    score += (ts.syncdays * 0.5) if ts.syncdays > 10
+  else
+    score += 1000000
+  end
+
+  if $actions[pkg] and $actions[pkg].act_todo
+    score += 100000 # bump score if action needed
+  end
+
+  if $popcon[pkg] < 1000
+    score += $popcon[pkg] / 10
+  else
+    score += 1000
+  end
+
+  if $rcbugs[pkg] > 0
+    if $rcbugs[pkg] > 4
+      score += 5 * 300
+    else
+      score += $rcbugs[pkg] * 300
+    end
+  end
+
+  # score bugs
+  if $bugs[pkg] > 0
+    pc = $popcon[pkg]
+    bugs = $bugs[pkg]
+    if pc < 4000
+      norm = 1 + 0.002 * pc
+    elsif pc < 60000
+      norm = 7.85 + (16.0/56000) * pc
+    else
+      norm = 25
+    end
+    if bugs > norm
+      ret = (bugs - norm)/norm * 100 * 10 # 10 % en trop -> 100 pts
+      score += (ret > 2000 ? 2000 : ret)
+    end
+  end
+  $score[pkg] = score if score > 0
+end
+
+f = File::new('scores-nmued.html', 'w')
+gen_html($score, f)
+f.close
 ########################################################################
 ######## -USELESS
 $uscore = {}

Modified: bapase/html.rb
===================================================================
--- bapase/html.rb	2008-01-13 22:28:11 UTC (rev 641)
+++ bapase/html.rb	2008-01-15 08:08:46 UTC (rev 642)
@@ -36,6 +36,7 @@
 <th>RC</th>
 <th>Bugs</th>
 <th>Last upload</th>
+<th>NMUs</th>
 <th>Comments</th>
 </tr>
 EOF
@@ -86,6 +87,11 @@
     else
       io.puts "<td></td>"
     end
+    if $nmus[pkg]
+      io.puts "<td>#{$nmus[pkg]}</td>"
+    else
+      io.puts "<td></td>"
+    end
     # comments
     if $actions[pkg]
       comment = $actions[pkg].act_comment.gsub(/#\d+/) do |bug|




More information about the Collab-qa-commits mailing list