浏览代码

set the correct item FileSize in by-hash case

In af81ab9030229b4ce6cbe28f0f0831d4896fda01 we implement by-hash as a
special compression type, which breaks this filesize setting as the code
is looking for a foobar.by-hash file then. Dealing this slightly gets
us the intended value. Note that this has no direct effect as this value
will be set in other ways, too, and could only effect progress reporting.

Gbp-Dch: Ignore
David Kalnischkies 10 年之前
父节点
当前提交
3084ef2292
共有 1 个文件被更改,包括 3 次插入 和 4 次删除
  1. 3 4
      apt-pkg/acquire-item.cc

+ 3 - 4
apt-pkg/acquire-item.cc

@@ -2865,10 +2865,6 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc,
    DestFile = GetPartialFileNameFromURI(URI);
    DestFile = GetPartialFileNameFromURI(URI);
    NextCompressionExtension(CurrentCompressionExtension, CompressionExtensions, false);
    NextCompressionExtension(CurrentCompressionExtension, CompressionExtensions, false);
 
 
-   // store file size of the download to ensure the fetcher gives
-   // accurate progress reporting
-   FileSize = GetExpectedHashes().FileSize();
-
    if (CurrentCompressionExtension == "uncompressed")
    if (CurrentCompressionExtension == "uncompressed")
    {
    {
       Desc.URI = URI;
       Desc.URI = URI;
@@ -2905,6 +2901,9 @@ void pkgAcqIndex::Init(string const &URI, string const &URIDesc,
       DestFile = DestFile + '.' + CurrentCompressionExtension;
       DestFile = DestFile + '.' + CurrentCompressionExtension;
    }
    }
 
 
+   // store file size of the download to ensure the fetcher gives
+   // accurate progress reporting
+   FileSize = GetExpectedHashes().FileSize();
 
 
    Desc.Description = URIDesc;
    Desc.Description = URIDesc;
    Desc.Owner = this;
    Desc.Owner = this;