Skip to content

Instantly share code, notes, and snippets.

@clrh
Created November 28, 2014 11:31
Show Gist options
  • Select an option

  • Save clrh/dde1f118112436864b44 to your computer and use it in GitHub Desktop.

Select an option

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
#!/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