diff options
author | Michael Vogt <mvo@ubuntu.com> | 2014-04-16 15:28:23 +0200 |
---|---|---|
committer | Michael Vogt <mvo@ubuntu.com> | 2014-04-16 15:28:23 +0200 |
commit | 1dca8dc55c1fcf4bda07a7e8285de7f225448697 (patch) | |
tree | 25366e329ee89765bbe92c0fb45f6c301ef6375d /apt-pkg/acquire-item.cc | |
parent | d0cfa8adbdd74ad7e363019739c77e713dc982e5 (diff) |
load the size from the metaindex into the fetcher to have even more accurate progress information
Diffstat (limited to 'apt-pkg/acquire-item.cc')
-rw-r--r-- | apt-pkg/acquire-item.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 6f6b3d59f..d5f8b0cc9 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -936,7 +936,7 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, Init(URI, URIDesc, ShortDesc); } pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target, - HashString const &ExpectedHash, indexRecords const *MetaIndexParser) + HashString const &ExpectedHash, indexRecords *MetaIndexParser) : Item(Owner), RealURI(Target->URI), ExpectedHash(ExpectedHash) { // autoselect the compression method @@ -963,6 +963,11 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const *Target, else Verify = true; + // load the filesize + indexRecords::checkSum *Record = MetaIndexParser->Lookup(string(Target->MetaKey)); + if(Record) + FileSize = Record->Size; + Init(Target->URI, Target->Description, Target->ShortDesc); } /*}}}*/ @@ -1176,9 +1181,13 @@ pkgAcqIndexTrans::pkgAcqIndexTrans(pkgAcquire *Owner, { } pkgAcqIndexTrans::pkgAcqIndexTrans(pkgAcquire *Owner, IndexTarget const *Target, - HashString const &ExpectedHash, indexRecords const *MetaIndexParser) + HashString const &ExpectedHash, indexRecords *MetaIndexParser) : pkgAcqIndex(Owner, Target, ExpectedHash, MetaIndexParser) { + // load the filesize + indexRecords::checkSum *Record = MetaIndexParser->Lookup(string(Target->MetaKey)); + if(Record) + FileSize = Record->Size; } /*}}}*/ // AcqIndexTrans::Custom600Headers - Insert custom request headers /*{{{*/ @@ -1575,7 +1584,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify) /*{{{*/ ++Target) { HashString ExpectedIndexHash; - const indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey); + indexRecords::checkSum *Record = MetaIndexParser->Lookup((*Target)->MetaKey); bool compressedAvailable = false; if (Record == NULL) { |