[Pkg-multidistrotools-commits] r8 - multidistrotools/trunk/scripts
raphink-guest at alioth.debian.org
raphink-guest at alioth.debian.org
Sun Dec 16 15:57:16 UTC 2007
Author: raphink-guest
Date: 2007-12-16 15:57:16 +0000 (Sun, 16 Dec 2007)
New Revision: 8
Modified:
multidistrotools/trunk/scripts/versions2html.rb
Log:
Add -i/--explanation and -j/--action options
Modified: multidistrotools/trunk/scripts/versions2html.rb
===================================================================
--- multidistrotools/trunk/scripts/versions2html.rb 2007-03-14 22:27:44 UTC (rev 7)
+++ multidistrotools/trunk/scripts/versions2html.rb 2007-12-16 15:57:16 UTC (rev 8)
@@ -31,6 +31,8 @@
STATES = [ 'notinA', 'outdatedinA', 'sameversionbutlocalinA', 'sameversion', 'sameversionbutlocalinB', 'sameversionbutlocalinboth', 'outdatedinB', 'notinB' ]
$commentstitle = []
$commentsuri = []
+$explanations = Hash::new
+$actions = Hash::new
$counts = Hash::new(0)
$texts = Hash::new("")
$labels = Hash::new
@@ -66,6 +68,14 @@
opts.on("-s", "--description DESCRIPTION", "Description for the list") do |s|
$description = s
end
+ opts.on("-i", "--explanation EXPLANATION", "Set state explanation (eg: \"notinA,binary package only\")") do |t|
+ s, c = t.split(',',2)
+ $explanations[s] = c
+ end
+ opts.on("-j", "--action ACTIONS", "Set state's action to take (eg: \"notinA,make a source package\")") do |t|
+ s, c = t.split(',',2)
+ $actions[s] = c
+ end
opts.on("-x", "--exclude STATE", "Exclude type from output") do |t|
if not STATES.include?(t)
puts "Unknown state: #{t} ! Valid states are #{STATES.join[' ']}."
@@ -84,7 +94,6 @@
end
opts.parse!(ARGV)
-
# labels
$labels['notinA'] = "Not in #{$titleA}"
$labels['outdatedinA'] = "Outdated in #{$titleA} (#{$titleB} version > #{$titleA} version)"
@@ -473,9 +482,10 @@
def caption
puts "<h2>Summary</h2><table class=\"pkglist\">"
+ puts "<tr><th>State</th><th>Number</th><th>Explanation</th><th>Action to take</th></tr>"
STATES.each do |s|
if not $excluded.include?(s)
- puts "<tr class=\"#{s}\"><td><a href=\"##{s}\">#{$labels[s]} : #{$counts[s]} packages</a></td></tr>"
+ puts "<tr class=\"#{s}\"><td><a href=\"##{s}\">#{$labels[s]}</a></td><td>#{$counts[s]} packages</td><td>#{$explanations[s]}</td><td>#{$actions[s]}</td></tr>"
end
end
puts "</table>"
@@ -769,6 +779,8 @@
if not $excluded.include?(state)
puts "<a name=\"#{state}\"></a>"
puts "<h2>#{$labels[state]} : #{$counts[state]} packages</h2>"
+ puts "Explanation: #{$explanations[state]}<br />" if $explanations[state]
+ puts "Action to take: #{$actions[state]}<br /><br />" if $actions[state]
tableheader
puts $texts[state]
tablefooter
More information about the Pkg-multidistrotools-commits
mailing list