aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MGA/Advisories.pm
diff options
context:
space:
mode:
authorColin Guthrie <colin@mageia.org>2014-10-07 10:04:56 +0100
committerColin Guthrie <colin@mageia.org>2014-10-07 10:05:04 +0100
commit2592347f89b5303dfdc8a448d5a705b913b4043c (patch)
tree4da525948f23f3d63108b3300e18a96d5fb5bd95 /lib/MGA/Advisories.pm
parent73e6c053928b415522281c9dcc65994f613b6c3c (diff)
downloadmgaadvisories-2592347f89b5303dfdc8a448d5a705b913b4043c.tar
mgaadvisories-2592347f89b5303dfdc8a448d5a705b913b4043c.tar.gz
mgaadvisories-2592347f89b5303dfdc8a448d5a705b913b4043c.tar.bz2
mgaadvisories-2592347f89b5303dfdc8a448d5a705b913b4043c.tar.xz
mgaadvisories-2592347f89b5303dfdc8a448d5a705b913b4043c.zip
Allow overriding of dependent bug check.
Sometimes a batch of updates will contain some updates dependent on other updates to be pushed at the same time. Until the update is actually pushed, the bug will not be closed. Thus a chicken and egg scenario. While we could evaluate which bugs are in the update queue to be processed and make sure we process them first and add them to an internal whitelist, this would require talking to bugzilla for all bugs first, then processing them. This approach is definitely possible and desirable and when a 'process-all' verb is added, this will likely be done. But in the short term, deferring to the user is easier!
Diffstat (limited to 'lib/MGA/Advisories.pm')
-rw-r--r--lib/MGA/Advisories.pm20
1 files changed, 19 insertions, 1 deletions
diff --git a/lib/MGA/Advisories.pm b/lib/MGA/Advisories.pm
index f8d7f48..63b6953 100644
--- a/lib/MGA/Advisories.pm
+++ b/lib/MGA/Advisories.pm
@@ -239,6 +239,7 @@ sub assign_id {
$failed = 1;
}
+ my $depsfailed = 0;
printf "%-40s", "Checking dependent bugs… ";
my $depends = $bug->{depends_on};
if (scalar(@$depends) < 1) {
@@ -254,7 +255,7 @@ sub assign_id {
if ($blocking_bug->{is_open}) {
print "✘ $dependent_bug_num";
- $failed = 1;
+ $depsfailed = 1;
} else {
print "✔ $dependent_bug_num";
}
@@ -267,6 +268,23 @@ sub assign_id {
print "\n";
}
+
+ if (!$failed && $depsfailed) {
+ ReadMode 4; # Turn off controls keys
+ print "Dependent bug! Publish anyway? [y/N]: ";
+ my $key = 'x';
+ while ( $key ne "\n" && $key ne "y" && $key ne "Y" && $key ne "n" && $key ne "N" ) {
+ $key = ReadKey(0);
+ }
+ ReadMode 0; # Reset tty mode before exiting
+ if ( $key eq "\n" || $key eq "n" || $key eq "N" ) {
+ $failed = 1;
+ print " ✘\n";
+ } else {
+ print " ✔\n";
+ }
+ }
+
printf "%-40s", "Checking SRPMs… ";
my $ua = LWP::UserAgent->new;
$ua->max_redirect(0);