#!/usr/bin/perl
use strict;
use warnings;
my @ListOfBugs; # Array of bugs
# Usage: perl KubuntuBugs.pl InputFileName
# Where InputFileName is cut and pasted from launchpad.net bug report.
#
# Goal: To read from: Ubuntu Bugs HTML Output and create wiki syntax for bug list, e.g.
# * (Bug:1403914) Crash after selecting timezone with non-US locale
while (<>) {
chomp;
s/^\s+|\s+$//g; # Remove leading and trailing spaces
if (/^#/) { # Bugs start with a # character
s/ /) /; # Substitute ) for first space to close the Bugs
s/^#/ * (Bug:/; # Substitute wiki bullet, followed by (Bug: for the opening #
push @ListOfBugs, "$_\n"; # Build Array of bugs followed by new line characters
}
}
print sort @ListOfBugs; # Print sorted array of bugs