Ubuntu Pastebin

Paste from marco-parillo at Thu, 24 Mar 2016 21:14:30 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/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
Download as text