X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/6b802e56f55a43e9967cd8d41148646fd95ea8e3..2b82aa5553eef0cd16b5803047a6b60450bee92f:/cmdline/acqprogress.cc diff --git a/cmdline/acqprogress.cc b/cmdline/acqprogress.cc index b3ded4142..ba334ce05 100644 --- a/cmdline/acqprogress.cc +++ b/cmdline/acqprogress.cc @@ -11,6 +11,7 @@ #include "acqprogress.h" #include #include +#include #include #include @@ -19,6 +20,7 @@ #include #include #include +#include /*}}}*/ using namespace std; @@ -150,7 +152,7 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) if (Quiet > 0) return true; - enum {Long = 0,Medium,Short} Mode = Long; + enum {Long = 0,Medium,Short} Mode = Medium; char Buffer[sizeof(BlankLine)]; char *End = Buffer + sizeof(Buffer); @@ -266,6 +268,16 @@ bool AcqTextStatus::Pulse(pkgAcquire *Owner) /* Prompt for a media swap */ bool AcqTextStatus::MediaChange(string Media,string Drive) { + // If we do not output on a terminal and one of the options to avoid user + // interaction is given, we assume that no user is present who could react + // on your media change request + if (isatty(STDOUT_FILENO) != 1 && Quiet >= 2 && + (_config->FindB("APT::Get::Assume-Yes",false) == true || + _config->FindB("APT::Get::Force-Yes",false) == true || + _config->FindB("APT::Get::Trivial-Only",false) == true)) + + return false; + if (Quiet <= 0) cout << '\r' << BlankLine << '\r'; ioprintf(cout,_("Media change: please insert the disc labeled\n"