summaryrefslogtreecommitdiff
path: root/apt-pkg/acquire.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <david@kalnischkies.de>2017-06-28 19:20:09 +0200
committerDavid Kalnischkies <david@kalnischkies.de>2017-06-28 19:20:09 +0200
commitdfe0e754a808aabd55f9cd68201a7f1432070836 (patch)
tree868ec0ba429d4df96b09a45c2f782c7c49786db3 /apt-pkg/acquire.cc
parentcbaf353ead58aa9eefe51542b6ad91e69b6289ce (diff)
parent24b5bc4e41ed527799a9fa01dec9c29294d0a3f2 (diff)
Merge branch 'feature/releaseinfochange'
Diffstat (limited to 'apt-pkg/acquire.cc')
-rw-r--r--apt-pkg/acquire.cc31
1 files changed, 30 insertions, 1 deletions
diff --git a/apt-pkg/acquire.cc b/apt-pkg/acquire.cc
index 8a6928fb9..f1dbff9f1 100644
--- a/apt-pkg/acquire.cc
+++ b/apt-pkg/acquire.cc
@@ -1406,10 +1406,39 @@ void pkgAcquireStatus::Stop()
// ---------------------------------------------------------------------
/* This is used to get accurate final transfer rate reporting. */
void pkgAcquireStatus::Fetched(unsigned long long Size,unsigned long long Resume)
-{
+{
FetchedBytes += Size - Resume;
}
/*}}}*/
+bool pkgAcquireStatus::ReleaseInfoChanges(metaIndex const * const LastRelease, metaIndex const * const CurrentRelease, std::vector<ReleaseInfoChange> &&Changes)/*{{{*/
+{
+ auto const virt = dynamic_cast<pkgAcquireStatus2*>(this);
+ if (virt != nullptr)
+ return virt->ReleaseInfoChanges(LastRelease, CurrentRelease, std::move(Changes));
+ return ReleaseInfoChangesAsGlobalErrors(std::move(Changes));
+}
+ /*}}}*/
+bool pkgAcquireStatus::ReleaseInfoChangesAsGlobalErrors(std::vector<ReleaseInfoChange> &&Changes)/*{{{*/
+{
+ bool AllOkay = true;
+ for (auto const &c: Changes)
+ if (c.DefaultAction)
+ _error->Notice("%s", c.Message.c_str());
+ else
+ {
+ _error->Error("%s", c.Message.c_str());
+ AllOkay = false;
+ }
+ return AllOkay;
+}
+ /*}}}*/
+bool pkgAcquireStatus2::ReleaseInfoChanges(metaIndex const * const, metaIndex const * const, std::vector<ReleaseInfoChange> &&Changes)
+{
+ return ReleaseInfoChangesAsGlobalErrors(std::move(Changes));
+}
+pkgAcquireStatus2::pkgAcquireStatus2() : pkgAcquireStatus() {}
+pkgAcquireStatus2::~pkgAcquireStatus2() {}
+
pkgAcquire::UriIterator::UriIterator(pkgAcquire::Queue *Q) : d(NULL), CurQ(Q), CurItem(0)
{