diff options
author | David Kalnischkies <david@kalnischkies.de> | 2015-08-22 00:10:08 +0200 |
---|---|---|
committer | David Kalnischkies <david@kalnischkies.de> | 2015-08-27 11:27:43 +0200 |
commit | b6a0018e1c4bb22132e0316a81b7a455c6333cf1 (patch) | |
tree | 59d5e169922e66c9ea752f7a9545d4ee6407dfc3 /apt-pkg | |
parent | 4c42650716d7347770e60260cff8d0d4777aaec0 (diff) |
correct 'apt update' download summary line
Fetched() was reported for mostly nothing, while we should be calling it
for files worked with from non-local sources (e.g. http, but not file or
xz). Previously this was called from an acquire item, but got moved to
the acquire worker instead to avoid having it (re)implemented in all
items, but the checks were faulty.
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/acquire-worker.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/apt-pkg/acquire-worker.cc b/apt-pkg/acquire-worker.cc index b15340448..176772dde 100644 --- a/apt-pkg/acquire-worker.cc +++ b/apt-pkg/acquire-worker.cc @@ -335,9 +335,10 @@ bool pkgAcquire::Worker::RunMessages() for (pkgAcquire::Queue::QItem::owner_iterator O = Itm->Owners.begin(); O != Itm->Owners.end(); ++O) Log->Pulse((*O)->GetOwner()); - std::string const filename = LookupTag(Message, "Filename", Itm->Owner->DestFile.c_str()); HashStringList ReceivedHashes; { + std::string const givenfilename = LookupTag(Message, "Filename"); + std::string const filename = givenfilename.empty() ? Itm->Owner->DestFile : givenfilename; // see if we got hashes to verify for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type) { @@ -358,11 +359,11 @@ bool pkgAcquire::Worker::RunMessages() ReceivedHashes = calc.GetHashStringList(); } } - } - // only local files can refer other filenames and counting them as fetched would be unfair - if (Log != NULL && filename != Itm->Owner->DestFile) - Log->Fetched(ReceivedHashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str())); + // only local files can refer other filenames and counting them as fetched would be unfair + if (Log != NULL && Itm->Owner->Complete == false && Itm->Owner->Local == false && givenfilename == filename) + Log->Fetched(ReceivedHashes.FileSize(),atoi(LookupTag(Message,"Resume-Point","0").c_str())); + } std::vector<Item*> const ItmOwners = Itm->Owners; OwnerQ->ItemDone(Itm); |