Hi all, After a short talk with Lucas I made some changes to bapase (not yet in the repository) which I'd like to get some feedback before committing them. The first set of changes (bapase_orphaned++.diff) is to score higher orphaned packages not in oldstable nor stable. With this score bump I'd like to catch some packages that are being uploaded and orphaned before a release is made. The second set of changes (bapase_dehs.diff) is making bapase DEHS-aware, changing the scores on the next basis: When scoring useless packages: score += (CURDATE - $dehs[pkg][last_in_sync_with_upstream]) * 2 When scoring orphaned packages: score += (CURDATE - $dehs[pkg][last_in_sync_with_upstream]) Comments, suggestions, all welcome. P.D. please review the code because I haven't, really, programmed in ruby so I can't say for sure that the code I wrote is ok. Cheers, -- Atomo64 - Raphael Please avoid sending me Word, PowerPoint or Excel attachments. See http://www.gnu.org/philosophy/no-word-attachments.html
Index: datafiles.rb =================================================================== --- datafiles.rb (revision 748) +++ datafiles.rb (working copy) @@ -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| Index: gen_html.rb =================================================================== --- gen_html.rb (revision 748) +++ gen_html.rb (working copy) @@ -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 @@ -168,6 +169,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
Index: datafiles.rb =================================================================== --- datafiles.rb (revision 748) +++ datafiles.rb (working copy) @@ -42,6 +42,17 @@ return nmus end +# from collab-qa/ddpo-by-mail/dehs.rb with some minor changes +def read_dehs + dehs = {} + IO::read('dehs.txt').each_line do |l| + pkg, unstable, upstream, date = l.chomp.split('|') + next if date == "1970-01-01 00:00:00" + d = Date::parse(date) + dehs[pkg] = [ unstable, upstream, d ] + end + return dehs +end class TestingStatus attr_accessor :testingversion, :unstableversion, :firstinunstable, :testingdays, :intesting, :syncdays, :sync, :syncversion Index: gen_html.rb =================================================================== --- gen_html.rb (revision 748) +++ gen_html.rb (working copy) @@ -19,6 +19,7 @@ $rcbugs, $bugs = read_bugs $wnpp = read_wnpp $removals = read_removals +$dehs = read_dehs $actions = Actions::read('package-actions.txt') $orph = OrphanedPackage::readfile $uploadhistory = LastUpload::readfile @@ -138,6 +139,9 @@ if $popcon[pkg] < 200 score += (200 - $popcon[pkg]) * 8 end + if $dehs.has_key?(pkg) + score += (CURDATE - $dehs[pkg][2]) * 2 + end if $uploadhistory.has_key?(pkg) uh = $uploadhistory[pkg] if CURDATE - uh.date > 30 @@ -174,6 +178,9 @@ if $popcon[pkg] < 500 score += (500 - $popcon[pkg]) * 2 end + if $dehs.has_key?(pkg) + score += (CURDATE - $dehs[pkg][2]) + end if $rcbugs[pkg] > 0 if $rcbugs[pkg] > 4 score += 5 * 300 Index: Makefile =================================================================== --- Makefile (revision 748) +++ Makefile (working copy) @@ -2,7 +2,7 @@ all: scores-html -scores-html: Sources_ok testing-status.txt popcon_sources.txt package-actions.txt bugsummary wnppsummary orphaned_packages.txt upload-history.txt removals.txt +scores-html: Sources_ok testing-status.txt popcon_sources.txt package-actions.txt bugsummary wnppsummary orphaned_packages.txt upload-history.txt removals.txt dehs.txt ./gen_html.rb Sources_ok: testing-main-Sources testing-contrib-Sources testing-non-free-Sources unstable-main-Sources unstable-contrib-Sources unstable-non-free-Sources stable-main-Sources stable-contrib-Sources stable-non-free-Sources oldstable-main-Sources oldstable-contrib-Sources oldstable-non-free-Sources experimental-main-Sources experimental-contrib-Sources experimental-non-free-Sources @@ -83,7 +83,10 @@ removals.txt: ./getremovals.rb > removals.txt +dehs.txt: + wget -O dehs.txt http://dehs.alioth.debian.org/ddpomail.txt + clean: - rm -f testing-status.txt *-Sources popcon_sources.txt scores.txt Sources_ok bts2ldap-fullindex RC+patch.txt bugsummary wnppsummary orphaned_packages.txt scores-buggy.html scores-orphaned.html upload-history.txt scores-useless.html removals.txt scores-nmued.html + rm -f testing-status.txt *-Sources popcon_sources.txt scores.txt Sources_ok bts2ldap-fullindex RC+patch.txt bugsummary wnppsummary orphaned_packages.txt scores-buggy.html scores-orphaned.html upload-history.txt scores-useless.html removals.txt scores-nmued.html dehs.txt .PHONY: clean scores-html
Attachment:
signature.asc
Description: This is a digitally signed message part.