aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MGA
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-11-24 20:35:47 +0000
committerColin Guthrie <colin@mageia.org>2014-11-25 10:30:51 +0000
commit4b023b7cfb13b03134ddb3b660863c76af6d1139 (patch)
tree517323c6940990570181aa4172031ecf5ab70760 /lib/MGA
parent62e6180b53eff8075f9c2dd8b359e972e190bc91 (diff)
downloadmgaadvisories-4b023b7cfb13b03134ddb3b660863c76af6d1139.tar
mgaadvisories-4b023b7cfb13b03134ddb3b660863c76af6d1139.tar.gz
mgaadvisories-4b023b7cfb13b03134ddb3b660863c76af6d1139.tar.bz2
mgaadvisories-4b023b7cfb13b03134ddb3b660863c76af6d1139.tar.xz
mgaadvisories-4b023b7cfb13b03134ddb3b660863c76af6d1139.zip
Buffer up our checklist text so we can use it later.
The intention is to post this to bugzilla.
Diffstat (limited to 'lib/MGA')
-rw-r--r--lib/MGA/Advisories.pm48
1 files changed, 31 insertions, 17 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index 3c9e147..482bf43 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -222,7 +222,9 @@ sub assign_id {
my $bug = $result->{bugs}->[0];
print "Found Bug: " . $bug->{summary} . "\n";
- printf "%-40s", "Checking for QA validation keyword… ";
+ my ($buffer, $msg);
+ print $msg = sprintf("%-40s", "Checking for QA validation keyword… ");
+ $buffer = $msg;
my $found_keyword = 0;
if (scalar($bug->{keywords}) > 0) {
my $keywords = $bug->{keywords};
@@ -234,45 +236,54 @@ sub assign_id {
}
}
if ($found_keyword) {
- print "✔\n";
+ print $msg = "✔\n";
} else {
- print "✘\n";
+ print $msg = "✘\n";
$failed = 1;
}
+ $buffer .= $msg;
my $depsfailed = 0;
- printf "%-40s", "Checking dependent bugs… ";
+ print $msg = sprintf("%-40s", "Checking dependent bugs… ");
+ $buffer .= $msg;
my $depends = $bug->{depends_on};
if (scalar(@$depends) < 1) {
- print "✔ (None found)\n";
+ print $msg = "✔ (None found)\n";
+ $buffer .= $msg;
} else {
my $first = 1;
foreach my $dependent_bug_num (@$depends) {
- print ', ' if (!$first);
+ if (!$first) {
+ print $msg = ', ';
+ $buffer .= $msg;
+ }
$first = 0;
if ($result = call_bz('Bug.get', {ids => [$dependent_bug_num]})) {
my $blocking_bug = $result->{bugs}->[0];
if ($blocking_bug->{is_open}) {
- print "✘ $dependent_bug_num";
+ print $msg = "✘ $dependent_bug_num";
$depsfailed = 1;
} else {
- print "✔ $dependent_bug_num";
+ print $msg = "✔ $dependent_bug_num";
}
} else {
print "? $dependent_bug_num\n";
print STDERR "Error: There was a problem communicating with bugzilla for bug $dependent_bug_num\n";
return;
}
+ $buffer .= $msg;
}
- print "\n";
+ print $msg = "\n";
+ $buffer .= $msg;
}
if (!$failed && $depsfailed) {
ReadMode 4; # Turn off controls keys
- print "Dependent bug! Publish anyway? [y/N]: ";
+ print $msg = "Dependent bug! Publish anyway? [y/N]: ";
+ $buffer .= $msg;
my $key = 'x';
while ( $key ne "\n" && $key ne "y" && $key ne "Y" && $key ne "n" && $key ne "N" ) {
$key = ReadKey(0);
@@ -280,13 +291,15 @@ sub assign_id {
ReadMode 0; # Reset tty mode before exiting
if ( $key eq "\n" || $key eq "n" || $key eq "N" ) {
$failed = 1;
- print " ✘\n";
+ print $msg = " ✘\n";
} else {
- print " ✔\n";
+ print $msg = " ✔\n";
}
+ $buffer .= $msg;
}
- printf "%-40s", "Checking SRPMs… ";
+ print $msg = sprintf("%-40s", "Checking SRPMs… ");
+ $buffer .= $msg;
my $ua = LWP::UserAgent->new;
$ua->max_redirect(0);
foreach my $rel (keys %{$adv->{src}}) {
@@ -296,16 +309,17 @@ sub assign_id {
my $resp = $ua->request($req);
if ($resp->code eq 302 && $resp->header('Location') =~ /\/qa\/checksrpm\/found$/) {
- print "✔ ";
+ print $msg = "✔ ";
} else {
- print "✘ ($rel/$media/$srpm) ";
+ print $msg = "✘ ($rel/$media/$srpm) ";
$failed = 1;
}
-
+ $buffer .= $msg;
}
}
}
- print "\n";
+ print $msg = "\n";
+ $buffer .= $msg;
if ($failed) {
print STDERR "Error: Cross check failed.\n";