From 2592347f89b5303dfdc8a448d5a705b913b4043c Mon Sep 17 00:00:00 2001 From: Colin Guthrie Date: Tue, 7 Oct 2014 10:04:56 +0100 Subject: 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! --- lib/MGA/Advisories.pm | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) 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); -- cgit v1.2.1