From d0cfa8adbdd74ad7e363019739c77e713dc982e5 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 16 Apr 2014 14:43:08 +0200 Subject: make the TotalFiles more reliable in apt-get update --- apt-pkg/acquire-item.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index f48d2a0d7..c12d8d63a 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -166,6 +166,16 @@ class pkgAcquire::Item : public WeakPointable * \sa pkgAcquire */ unsigned int QueueCounter; + + /** \brief The number of additional fetch items that are expected + * once this item is done. + * + * Some items like pkgAcqMeta{Index,Sig} will queue additional + * items. This variable can be set by the methods if it knows + * in advance how many items to expect to get a more accurate + * progress. + */ + unsigned int ExpectedAdditionalItems; /** \brief The name of the file into which the retrieved object * will be written. -- cgit v1.2.3 From 1dca8dc55c1fcf4bda07a7e8285de7f225448697 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 16 Apr 2014 15:28:23 +0200 Subject: load the size from the metaindex into the fetcher to have even more accurate progress information --- apt-pkg/acquire-item.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index c12d8d63a..bf5cb09c8 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -756,7 +756,7 @@ class pkgAcqIndex : public pkgAcquire::Item std::string ShortDesc, HashString ExpectedHash, std::string compressExt=""); pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target, - HashString const &ExpectedHash, indexRecords const *MetaIndexParser); + HashString const &ExpectedHash, indexRecords *MetaIndexParser); void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc); }; /*}}}*/ @@ -788,7 +788,7 @@ class pkgAcqIndexTrans : public pkgAcqIndex pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc); pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target, - HashString const &ExpectedHash, indexRecords const *MetaIndexParser); + HashString const &ExpectedHash, indexRecords *MetaIndexParser); }; /*}}}*/ /** \brief Information about an index file. */ /*{{{*/ -- cgit v1.2.3 From 96c6cab1fd5a5de19fbd552b42e1dd1c08417946 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 16 Apr 2014 17:41:11 +0200 Subject: calculate Percent as part of pkgAcquireStatus to provide a weighted percent for both items and bytes --- apt-pkg/acquire-item.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index bf5cb09c8..ab4a69c13 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -723,6 +723,11 @@ class pkgAcqIndex : public pkgAcquire::Item */ std::string CompressionExtension; + /** \brief Pointer to the IndexTarget data + */ + const struct IndexTarget * Target; + indexRecords *MetaIndexParser; + public: // Specialized action members -- cgit v1.2.3 From e39698a485e332742b935292dc4329abf19cbb53 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 17 Apr 2014 11:39:58 +0200 Subject: pass Target/MetaIndexParser around into pkgAcqDiffIndex so that this can be used to create a proper pkgAcqIndex() with size information --- apt-pkg/acquire-item.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'apt-pkg/acquire-item.h') diff --git a/apt-pkg/acquire-item.h b/apt-pkg/acquire-item.h index ab4a69c13..eab5bb222 100644 --- a/apt-pkg/acquire-item.h +++ b/apt-pkg/acquire-item.h @@ -405,6 +405,11 @@ class pkgAcqDiffIndex : public pkgAcquire::Item */ std::string Description; + /** \brief Pointer to the IndexTarget data + */ + const struct IndexTarget * Target; + indexRecords *MetaIndexParser; + public: // Specialized action members virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf); @@ -438,8 +443,10 @@ class pkgAcqDiffIndex : public pkgAcquire::Item * * \param ExpectedHash The list file's MD5 signature. */ - pkgAcqDiffIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc, - std::string ShortDesc, HashString ExpectedHash); + pkgAcqDiffIndex(pkgAcquire *Owner, + struct IndexTarget const * const Target, + HashString ExpectedHash, + indexRecords *MetaIndexParser); }; /*}}}*/ /** \brief An item that is responsible for fetching client-merge patches {{{ -- cgit v1.2.3