bool runningShell() const { return _running_shell; }
bool runningHelp() const { return _running_help; }
bool exitRequested() const { return _exit_requested; }
- void requestExit() { _exit_requested = true; }
+ void requestExit(bool do_exit = true) { _exit_requested = do_exit; }
int argc() { return _running_shell ? _sh_argc : _argc; }
char ** argv() { return _running_shell ? _sh_argv : _argv; }
_("Please insert medium [%s] #%d and type 'y' to continue or 'n' to cancel the operation."))
% label % mediumNr);
if (read_bool_answer(PROMPT_YN_MEDIA_CHANGE, request, false))
+ {
+ zypper.requestExit(false);
return MediaChangeReport::RETRY;
+ }
else
return MediaChangeReport::ABORT;
}
if (error == MediaChangeReport::IO_SOFT)
{
- MediaChangeReport::Action action = MediaChangeReport::RETRY;
+ MediaChangeReport::Action default_action = MediaChangeReport::RETRY;
if (repeat_counter.counter_overrun(url))
- action = MediaChangeReport::ABORT;
- return (Action) read_action_ari_with_timeout(PROMPT_ARI_MEDIA_PROBLEM,
- 30,action);
+ default_action = MediaChangeReport::ABORT;
+
+ MediaChangeReport::Action action = (Action) read_action_ari_with_timeout(
+ PROMPT_ARI_MEDIA_PROBLEM, 30, default_action);
+
+ if (action == MediaChangeReport::RETRY)
+ zypper.requestExit(false);
+
+ return action;
}
Action action = MediaChangeReport::ABORT;
&& !zypper.runtimeData().seen_verify_hint)
print_verify_hint(Zypper::instance()->out());
+ if (action == MediaChangeReport::RETRY)
+ zypper.requestExit(false);
+
return action;
}
return true;
Zypper & zypper = *(Zypper::instance());
+
+ if (zypper.exitRequested())
+ {
+ DBG << "received exit request" << std::endl;
+ return false;
+ }
+
if (!zypper.runtimeData().raw_refresh_progress_label.empty())
zypper.out().progress(
"raw-refresh", zypper.runtimeData().raw_refresh_progress_label);
return true;
}
- // not used anywhere in libzypp 3.20.0 (really)
virtual DownloadProgressReport::Action
problem( const zypp::Url & uri, DownloadProgressReport::Error error, const std::string & description )
{
Zypper::instance()->out().dwnldProgressEnd(uri, _last_drate_avg, true);
Zypper::instance()->out().error(zcb_error2str(error, description));
- return (Action) read_action_ari(PROMPT_ARI_MEDIA_PROBLEM, DownloadProgressReport::ABORT);
+ Action action = (Action) read_action_ari(
+ PROMPT_ARI_MEDIA_PROBLEM, DownloadProgressReport::ABORT);
+ if (action == DownloadProgressReport::RETRY)
+ Zypper::instance()->requestExit(false);
+ return action;
}
// used only to finish, errors will be reported in media change callback (libzypp 3.20.0)