Created
November 28, 2014 11:31
-
-
Save clrh/dde1f118112436864b44 to your computer and use it in GitHub Desktop.
Just find status of bugzilla numbers given in a file - Use https://github.com/frasertweedale/bugzillatools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/perl | |
| # | |
| # Just find status of bugzilla numbers given in a file. | |
| # Use https://github.com/frasertweedale/bugzillatools | |
| # | |
| # perl thisfile.pl bznum > statusoutput.csv | |
| # | |
| # $ cat bznum | |
| # 42 | |
| # 1024 | |
| # 1337 | |
| # | |
| # $ cat statusoutput.csv | |
| # 42 ; In progress | |
| # 1024 ; Assigned | |
| # 1337 ; Pushed | |
| # | |
| use Modern::Perl; | |
| use Data::Dump qw (dump); | |
| my $commande = "bugzilla info "; | |
| my @res; | |
| my @grep; | |
| my $bz; | |
| my $bzstatus; | |
| for my $file ( @ARGV ) { | |
| open(FD, $file) or say "Error: '$file' $!" and next; | |
| while ( <FD> ) { | |
| $bz = $_; | |
| chomp $bz; | |
| if ($bz eq "") { print "---------------\n"; next;}; | |
| @res = `$commande $bz`; | |
| @grep = grep (/status:/, @res); | |
| $bzstatus = $1 if ($grep[0] =~ m/status:(.*)/); | |
| print "$bz ; $bzstatus\n"; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment