[DRE-commits] [SCM] Tracking the Debian/Ruby wheezy transition branch, master, updated. 530cdac22c28bac03bcedb229247ff48206fa680
Antonio Terceiro
terceiro at softwarelivre.org
Wed Apr 6 19:06:16 UTC 2011
The following commit has been merged in the master branch:
commit fccf5cb4dc078fccbbeb036d12979d9937dfb896
Author: Antonio Terceiro <terceiro at softwarelivre.org>
Date: Wed Apr 6 11:33:21 2011 -0700
Incorporating detailed view.
Copied the SQL queries from original script by Lucas Nussbaum.
diff --git a/Makefile b/Makefile
index 125247f..e4c1a34 100644
--- a/Makefile
+++ b/Makefile
@@ -1,13 +1,11 @@
-all: details.html update
+all: stamp
-update:
+stamp:
ruby retrieve.rb
-
-details.html:
- wget -q -O $@ http://udd.debian.org/cgi-bin/ruby-transition.cgi
+ touch stamp
clean:
- $(RM) details.html
+ $(RM) stamp
reload:
$(MAKE) clean
diff --git a/details.html.erb b/details.html.erb
new file mode 100644
index 0000000..f17116b
--- /dev/null
+++ b/details.html.erb
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+ <title>Details about the Debian/Ruby Wheezy Transition</title>
+ <link rel='stylesheet' type='text/css' href='style.css'/>
+ </head>
+ <body>
+ <h1>Details about the Debian/Ruby Wheezy Transition</h1>
+ <p>
+ <a href='.'>Go back to overview page</a>
+ </p>
+ <h2>Packages using old policy (<span class='pending'>pending</span>): <%= pending_packages.count %></h2>
+ <table class='buglist'>
+ <tr>
+ <th>source</th>
+ <th>package</th>
+ <th>arch</th>
+ <th>popcon</th>
+ <th>maintainer</th>
+ <th>uploaders</th>
+ </tr>
+ <% pending_packages.each do |package| %>
+ <tr>
+ <td><%= package['source'] %></th>
+ <td><%= package['binary'] %></th>
+ <td><%= package['arch'] %></th>
+ <td><%= package['popcon'] %></th>
+ <td><%= package['maintainer'] %></th>
+ <td><%= package['uploaders'] %></th>
+ </tr>
+ <% end %>
+ </table>
+ <h2>Packages using new policy (<span class='done'>done</a>): <%= done_packages.count %></h2>
+ <table class='buglist'>
+ <tr>
+ <th>source</th>
+ <th>package</th>
+ <th>arch</th>
+ <th>popcon</th>
+ <th>maintainer</th>
+ <th>uploaders</th>
+ </tr>
+ <% done_packages.each do |package| %>
+ <tr>
+ <td><%= package['source'] %></th>
+ <td><%= package['binary'] %></th>
+ <td><%= package['arch'] %></th>
+ <td><%= package['maintainer'] %></th>
+ <td><%= package['uploaders'] %></th>
+ </tr>
+ <% end %>
+ </table>
+ <h2>About this service</h2>
+ <p>
+ Source code for this service <a href='http://git.debian.org/?p=pkg-ruby-extras/wheezy-transition-tracker.git;a=summary'>is available</a> on <code>git.debian.org</code>.
+ <em>Data from <a href='http://udd.debian.org/'>UDD</a>, updated daily.</em>
+ </p>
+ </body>
+</html>
diff --git a/index.html b/index.html
index f19f1cd..1e86f67 100644
--- a/index.html
+++ b/index.html
@@ -15,6 +15,7 @@
<li>Pending: packages using old policy</li>
<li>Done: packages using <a href='http://wiki.debian.org/Teams/Ruby/RubyInWheezy'>new policy</a></li>
</ul>
+ <li>Pass the mouse pointer over a point to see it's exact Y value</li>
</li>
<li><a href='details.html'>See the details of the current state</a></li>
</ul>
diff --git a/retrieve.rb b/retrieve.rb
index b338b43..75f3754 100644
--- a/retrieve.rb
+++ b/retrieve.rb
@@ -1,17 +1,54 @@
require 'open-uri'
require 'json'
require 'fileutils'
+require 'pg'
+require 'date'
+require 'erb'
data = []
+# accumulate data series points
if File.exists?('data.json')
FileUtils.cp('data.json', 'data.json~')
data = JSON.load(File.read('data.json'))
end
-new_data = JSON.load(open('http://pkg-ruby-extras.alioth.debian.org/cgi-bin/wheezy-transition-data').read)
-data << new_data
+# get new data
+connection = PGconn.open(:service => 'udd')
+pending_packages_query = <<EOF
+select distinct s.source as source, p.package as binary, s.architecture as arch, coalesce(pc.insts, 0) as popcon, s.maintainer as maintainer, s.uploaders as uploaders
+from packages p, sources_uniq s
+left join sources_popcon pc on (s.source = pc.source)
+where s.distribution = 'debian' and s.release='sid'
+and p.distribution = 'debian' and p.release='sid' and s.source = p.source
+and (s.source ~ 'lib.*-ruby' or p.package ~ 'lib.*-ruby.*' or s.build_depends ~ '.*ruby-pkg-tools.*')
+order by source, package;
+EOF
+done_packages_query = <<EOF
+select distinct s.source as source, p.package as binary, s.architecture as arch, s.maintainer as maintainer, s.uploaders as uploaders
+from packages p, sources_uniq s
+where s.distribution = 'debian' and s.release='sid'
+and p.distribution = 'debian' and p.release='sid' and s.source = p.source
+and (s.build_depends ~ '.*gem2deb.*')
+order by source, package;
+EOF
+
+pending_packages = connection.exec(pending_packages_query)
+done_packages = connection.exec(done_packages_query)
+
+new_time_data = {
+ 'date' => Date.today.strftime('%Y%m%d').to_i,
+ 'pending' => pending_packages.count,
+ 'done' => done_packages.count,
+}
+data << new_time_data
+
+# write data files
File.open('data.json', 'w') do |f|
f.write(data.to_json)
end
+File.open('details.html', 'w') do |f|
+ template = ERB.new(File.read('details.html.erb'))
+ f.puts(template.result(binding))
+end
diff --git a/style.css b/style.css
index e1f70bb..eb932c1 100644
--- a/style.css
+++ b/style.css
@@ -4,6 +4,25 @@ body {
}
#progress {
- width: 600px;
- height: 300px;
+ width: 1000px;
+ height: 400px;
+}
+
+table.buglist td, table.buglist th {
+ border: 1px solid gray;
+ padding-left: 3px;
+ padding-right: 3px;
+}
+table.buglist tr:hover {
+ background-color: #ccc;
+ color: #000;
+}
+table.buglist tr:hover :link {
+ color: #00f;
+}
+table.buglist tr:hover :visited {
+ color: #707;
+}
+table {
+ border-collapse: collapse;
}
--
Tracking the Debian/Ruby wheezy transition
More information about the Pkg-ruby-extras-commits
mailing list