[Collab-qa-commits] r753 - bapase

atomo64-guest at alioth.debian.org atomo64-guest at alioth.debian.org
Wed Apr 2 02:06:01 UTC 2008


Author: atomo64-guest
Date: 2008-04-02 02:06:00 +0000 (Wed, 02 Apr 2008)
New Revision: 753

Modified:
   bapase/datafiles.rb
   bapase/gen_html.rb
Log:
Score orphaned packages higher if the package does not exist neither in stable nor oldstable


Modified: bapase/datafiles.rb
===================================================================
--- bapase/datafiles.rb	2008-04-02 02:03:49 UTC (rev 752)
+++ bapase/datafiles.rb	2008-04-02 02:06:00 UTC (rev 753)
@@ -22,6 +22,30 @@
   return [srcpkg, pkgs]
 end
 
+# same as above but for stable and oldstable (we don't want to mix them with unstable & testing)
+def read_oldsources
+  srcpkg = {}
+  pkgs = {}
+  Dir::glob('{,old}stable-*-Sources') do |s|
+    src = nil
+    IO::read(s).each_line do |l|
+      if l =~ /^Package:/
+        src = l.split(' ')[1].chomp
+        pkgs[src] = [] if pkgs[src].nil?
+      elsif l =~ /^Binary:/
+        l.split(' ',2)[1].split(', ').each do |b|
+          b.chomp!
+          if srcpkg[b].nil? # else, we already know that binary pkg
+            srcpkg[b] = src
+            pkgs[src] << b
+          end
+        end
+      end
+    end
+  end
+  return [srcpkg, pkgs]
+end
+
 def read_nmus
   nmus = {}
   Dir::glob('unstable-*-Sources') do |s|

Modified: bapase/gen_html.rb
===================================================================
--- bapase/gen_html.rb	2008-04-02 02:03:49 UTC (rev 752)
+++ bapase/gen_html.rb	2008-04-02 02:06:00 UTC (rev 753)
@@ -14,6 +14,7 @@
 
 $testing = read_testing
 $srcpkg, $pkgs = read_sources
+$old_srcpkg, $old_pkgs = read_sources
 $nmus = read_nmus
 $popcon = read_popcon
 $rcbugs, $bugs = read_bugs
@@ -172,6 +173,9 @@
   else
     score += 1000000
   end
+  if !$old_pkgs.has_key?(pkg)
+    score += 1000000
+  end
   if $actions[pkg] and $actions[pkg].act_todo
     score += 100000 # bump score if action needed
   end




More information about the Collab-qa-commits mailing list