# HG changeset patch # User William Roberts # Date 1248273558 -3600 # Node ID 36e05c0da8f73d92a1dfee3be2acbd904ea7e80d # Parent 54785ea4cd2e4ce16ed4a265e5e73686af52c40a Trivial script to convert a "copied" bugzilla bug listing into a Mediawiki table diff -r 54785ea4cd2e -r 36e05c0da8f7 williamr/buglist_to_mediawiki.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/williamr/buglist_to_mediawiki.pl Wed Jul 22 15:39:18 2009 +0100 @@ -0,0 +1,46 @@ +#! perl + +# Copyright (c) 2009 Symbian Foundation Ltd +# This component and the accompanying materials are made available +# under the terms of the License "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Symbian Foundation Ltd - initial contribution. +# +# Contributors: +# +# Description: +# Convert tab-separated buglist into Mediawiki table + +use strict; + +my $line; +my $header = 1; + +while ($line =<>) + { + chomp $line; + my @columns = split /\t/, $line; + + next if scalar @columns < 2; # skip dubious looking lines + + if ($header) + { + print "{|\n"; # start of table + print "! ", join(" !! ", @columns), "\n"; + $header = 0; + next; + } + + # row with a bug id + my $id = shift @columns; + $id = sprintf "[http://developer.symbian.org/bugs/show_bug.cgi?id=%s Bug %s]", $id, $id; + unshift @columns, $id; + + print "|-\n"; # row separator + print "| ", join(" || ", @columns), "\n"; + } + +print "|}\n";