| 1 |
#!/usr/bin/ruby -w
|
| 2 |
|
| 3 |
require 'date'
|
| 4 |
require 'pkgtestingstatus'
|
| 5 |
|
| 6 |
$curdate = Date::parse('0000-01-01')
|
| 7 |
|
| 8 |
pkgs = PkgTestingStatus::read(STDIN)
|
| 9 |
|
| 10 |
pkgs.each_pair do |name, pkg|
|
| 11 |
$curdate = pkg.intesting if pkg.intesting > $curdate
|
| 12 |
$curdate = pkg.inunstable if pkg.inunstable > $curdate
|
| 13 |
$curdate = pkg.sync if pkg.sync > $curdate
|
| 14 |
end
|
| 15 |
|
| 16 |
# read comments
|
| 17 |
comments = {}
|
| 18 |
IO::read('comments/comments.txt').each_line do |l|
|
| 19 |
next if l =~ /^\s*#/
|
| 20 |
p, c = l.split(' ', 2)
|
| 21 |
comments[p] = c
|
| 22 |
end
|
| 23 |
|
| 24 |
# read wnpp data
|
| 25 |
orphaned = {}
|
| 26 |
str = `wget -q -O - http://www.debian.org/devel/wnpp/orphaned`.chomp
|
| 27 |
str.scan(/<a href="http:\/\/bugs.debian.org\/(\d+)">(\w+):/) do |bug, pkg|
|
| 28 |
orphaned[pkg] = bug
|
| 29 |
end
|
| 30 |
|
| 31 |
# exclude non-interesting stuff
|
| 32 |
pkgs = pkgs.to_a.reject do |p|
|
| 33 |
# puts "#{p[0]} #{$curdate} #{p[1].sync} #{p[1].inunstable}<br/>"
|
| 34 |
# puts "cl from sync" if $curdate - p[1].sync < 10
|
| 35 |
# puts "notinunstable" if p[1].inunstable != $curdate
|
| 36 |
($curdate - p[1].sync < 10) or (p[1].inunstable != $curdate)
|
| 37 |
end
|
| 38 |
|
| 39 |
|
| 40 |
puts <<-EOF
|
| 41 |
<html>
|
| 42 |
<head>
|
| 43 |
<title>Packages testing status</title>
|
| 44 |
<style type="text/css">
|
| 45 |
print status information
|
| 46 |
html, body {
|
| 47 |
background-color: #FFFFFF;
|
| 48 |
color: #000000;
|
| 49 |
font-family: sans-serif;
|
| 50 |
}
|
| 51 |
|
| 52 |
h1 {
|
| 53 |
text-align: center;
|
| 54 |
}
|
| 55 |
|
| 56 |
|
| 57 |
table {
|
| 58 |
border: 1px solid black;
|
| 59 |
padding: 0px;
|
| 60 |
border-collapse: collapse;
|
| 61 |
}
|
| 62 |
|
| 63 |
th {
|
| 64 |
border: 1px solid black;
|
| 65 |
padding-top: 3px;
|
| 66 |
padding-bottom: 3px;
|
| 67 |
padding-left: 5px;
|
| 68 |
padding-right: 5px;
|
| 69 |
}
|
| 70 |
|
| 71 |
td {
|
| 72 |
border: 1px dotted black;
|
| 73 |
padding: 3px;
|
| 74 |
text-align: center;
|
| 75 |
}
|
| 76 |
</style>
|
| 77 |
</head>
|
| 78 |
<body>
|
| 79 |
<h1>Packages testing status</h1>
|
| 80 |
<p>This page answers the two following questions:</p>
|
| 81 |
<ul>
|
| 82 |
<li><b>When was package X last in testing ?</b></li>
|
| 83 |
<li><b>When was package X last in sync between testing and unstable ?</b></li>
|
| 84 |
</ul>
|
| 85 |
<p>(The second question is useful in the case of packages that are in testing, but where newer versions fail to transition.)</p>
|
| 86 |
<p>Packages which were last in sync less than 10 days ago are excluded.</p>
|
| 87 |
<p><a href="#lasttesting">List sorted by how long ago the package was last in testing</a><br/>
|
| 88 |
<a href="#lastsync">List sorted by how long ago the package was last the same in testing and unstable</a></p>
|
| 89 |
<p>Current date: #{$curdate}</p>
|
| 90 |
<a name="lasttesting"></a>
|
| 91 |
<h2>List sorted by how long ago the package was last in testing</h2>
|
| 92 |
<p>Packages in testing are excluded from the list, even if the version in unstable differs.</p>
|
| 93 |
<table border="1">
|
| 94 |
<tr><th rowspan='2'>package</th><th colspan='3'>last in testing</th>
|
| 95 |
<th colspan='3'>last in sync</th><th colspan='2'>unstable</th><th rowspan='2'>comments</th></tr>
|
| 96 |
<tr><th>date</th><th>days</th><th>version</th><th>date</th><th>days</th><th>version</th><th>version</th><th>first seen</th></tr>
|
| 97 |
EOF
|
| 98 |
|
| 99 |
pkgs.reject { |p| p[1].intesting == $curdate }.sort { |a, b| a[1].testingdays <=> b[1].testingdays }.reverse.each do |p|
|
| 100 |
puts p[1].to_row(p[0], orphaned[p[0]], comments[p[0]])
|
| 101 |
end
|
| 102 |
|
| 103 |
puts "</table>"
|
| 104 |
puts <<-EOF
|
| 105 |
<a name="lastsync"></a>
|
| 106 |
<h2>List sorted by how long ago the package was last the same in testing and unstable</h2>
|
| 107 |
<table border="1">
|
| 108 |
<tr><th rowspan='2'>package</th><th colspan='3'>last in testing</th>
|
| 109 |
<th colspan='3'>last in sync</th><th colspan='2'>unstable</th><th rowspan='2'>comments</th></tr>
|
| 110 |
<tr><th>date</th><th>days</th><th>version</th><th>date</th><th>days</th><th>version</th><th>version</th><th>first seen</th></tr>
|
| 111 |
EOF
|
| 112 |
pkgs.sort { |a, b| a[1].syncdays <=> b[1].syncdays }.reverse.each do |p|
|
| 113 |
puts p[1].to_row(p[0], orphaned[p[0]], comments[p[0]])
|
| 114 |
end
|
| 115 |
puts "</table>"
|
| 116 |
puts "</body></html>"
|