summaryrefslogtreecommitdiff
path: root/apt-private/acqprogress.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-private/acqprogress.cc')
-rw-r--r--apt-private/acqprogress.cc34
1 files changed, 27 insertions, 7 deletions
diff --git a/apt-private/acqprogress.cc b/apt-private/acqprogress.cc
index e4bfbd4e5..a788ec98b 100644
--- a/apt-private/acqprogress.cc
+++ b/apt-private/acqprogress.cc
@@ -7,22 +7,23 @@
##################################################################### */
/*}}}*/
// Include files /*{{{*/
-#include<config.h>
+#include <config.h>
-#include <apt-pkg/acquire.h>
#include <apt-pkg/acquire-item.h>
#include <apt-pkg/acquire-worker.h>
+#include <apt-pkg/acquire.h>
#include <apt-pkg/configuration.h>
-#include <apt-pkg/strutl.h>
#include <apt-pkg/error.h>
+#include <apt-pkg/strutl.h>
#include <apt-private/acqprogress.h>
+#include <apt-private/private-output.h>
-#include <string.h>
-#include <stdio.h>
-#include <signal.h>
#include <iostream>
#include <sstream>
+#include <signal.h>
+#include <stdio.h>
+#include <string.h>
#include <unistd.h>
#include <apti18n.h>
@@ -32,7 +33,7 @@
// ---------------------------------------------------------------------
/* */
AcqTextStatus::AcqTextStatus(std::ostream &out, unsigned int &ScreenWidth,unsigned int const Quiet) :
- pkgAcquireStatus(), out(out), ScreenWidth(ScreenWidth), LastLineLength(0), ID(0), Quiet(Quiet)
+ pkgAcquireStatus2(), out(out), ScreenWidth(ScreenWidth), LastLineLength(0), ID(0), Quiet(Quiet)
{
// testcases use it to disable pulses without disabling other user messages
if (Quiet == 0 && _config->FindB("quiet::NoUpdate", false) == true)
@@ -330,6 +331,25 @@ bool AcqTextStatus::MediaChange(std::string Media, std::string Drive)
return bStatus;
}
/*}}}*/
+bool AcqTextStatus::ReleaseInfoChanges(metaIndex const * const L, metaIndex const * const N, std::vector<ReleaseInfoChange> &&Changes)/*{{{*/
+{
+ if (Quiet >= 2 || isatty(STDOUT_FILENO) != 1 || isatty(STDIN_FILENO) != 1 ||
+ _config->FindB("APT::Get::Update::InteractiveReleaseInfoChanges", false) == false)
+ return pkgAcquireStatus2::ReleaseInfoChanges(nullptr, nullptr, std::move(Changes));
+
+ _error->PushToStack();
+ auto const confirmed = pkgAcquireStatus2::ReleaseInfoChanges(L, N, std::move(Changes));
+ if (confirmed == true)
+ {
+ _error->MergeWithStack();
+ return true;
+ }
+ clearLastLine();
+ _error->DumpErrors(out, GlobalError::NOTICE, false);
+ _error->RevertToStack();
+ return YnPrompt(_("Do you want to accept these changes and continue updating from this repository?"), false, false, out, out);
+}
+ /*}}}*/
void AcqTextStatus::clearLastLine() { /*{{{*/
if (Quiet > 0 || LastLineLength == 0)
return;