From: Michael Vogt <mvo@ubuntu.com>
Date: Mon, 29 Sep 2014 06:33:33 +0000 (+0200)
Subject: Merge branch 'debian/sid' into debian/experimental
X-Git-Tag: 1.1.exp4~23
X-Git-Url: https://git.saurik.com/apt.git/commitdiff_plain/48f3f1b24b48066cfc23342a5c6470ddf5e0fa6a

Merge branch 'debian/sid' into debian/experimental

Conflicts:
	apt-pkg/acquire-item.cc
---

48f3f1b24b48066cfc23342a5c6470ddf5e0fa6a
diff --cc apt-pkg/acquire-item.cc
index d1c1f8c5a,2401364a9..f46c8a6e4
--- a/apt-pkg/acquire-item.cc
+++ b/apt-pkg/acquire-item.cc
@@@ -1012,28 -967,11 +1012,29 @@@ void pkgAcqIndex::Init(string const &UR
     DestFile += URItoFileName(URI);
  
     std::string const comprExt = CompressionExtension.substr(0, CompressionExtension.find(' '));
 +   std::string MetaKey;
     if (comprExt == "uncompressed")
 +   {
        Desc.URI = URI;
 -   else {
 +      if(Target)
 +         MetaKey = string(Target->MetaKey);
 +   }
 +   else
 +   {
        Desc.URI = URI + '.' + comprExt;
+       DestFile = DestFile + '.' + comprExt;
 +      if(Target)
 +         MetaKey = string(Target->MetaKey) + '.' + comprExt;
 +   }
 +
 +   // load the filesize
 +   if(MetaIndexParser)
 +   {
 +      indexRecords::checkSum *Record = MetaIndexParser->Lookup(MetaKey);
 +      if(Record)
 +         FileSize = Record->Size;
 +      
 +      InitByHashIfNeeded(MetaKey);
     }
  
     Desc.Description = URIDesc;
@@@ -1078,15 -984,19 +1079,16 @@@ void pkgAcqIndex::InitByHashIfNeeded(co
  // AcqIndex::Custom600Headers - Insert custom request headers		/*{{{*/
  // ---------------------------------------------------------------------
  /* The only header we use is the last-modified header. */
 -string pkgAcqIndex::Custom600Headers()
 +string pkgAcqIndex::Custom600Headers() const
  {
+    std::string const compExt = CompressionExtension.substr(0, CompressionExtension.find(' '));
     string Final = _config->FindDir("Dir::State::lists");
     Final += URItoFileName(RealURI);
     if (_config->FindB("Acquire::GzipIndexes",false))
-       Final += ".gz";
+       Final += compExt;
     
     string msg = "\nIndex-File: true";
 -   // FIXME: this really should use "IndexTarget::IsOptional()" but that
 -   //        seems to be difficult without breaking ABI
 -   if (ShortDesc().find("Translation") != 0)
 -      msg += "\nFail-Ignore: true";
 +
     struct stat Buf;
     if (stat(Final.c_str(),&Buf) == 0)
        msg += "\nLast-Modified: " + TimeRFC1123(Buf.st_mtime);
@@@ -1313,13 -1215,13 +1322,13 @@@ pkgAcqIndexTrans::pkgAcqIndexTrans(pkgA
  									/*}}}*/
  // AcqIndexTrans::Custom600Headers - Insert custom request headers	/*{{{*/
  // ---------------------------------------------------------------------
 -string pkgAcqIndexTrans::Custom600Headers()
 +string pkgAcqIndexTrans::Custom600Headers() const
  {
+    std::string const compExt = CompressionExtension.substr(0, CompressionExtension.find(' '));
     string Final = _config->FindDir("Dir::State::lists");
     Final += URItoFileName(RealURI);
- 
     if (_config->FindB("Acquire::GzipIndexes",false))
-       Final += ".gz";
+       Final += compExt;
  
     struct stat Buf;
     if (stat(Final.c_str(),&Buf) != 0)