Browse Source

Merge remote-tracking branch 'upstream/debian/experimental' into feature/acq-trans

Conflicts:
	apt-pkg/acquire-item.cc
Michael Vogt 9 years ago
parent
commit
4d0818cc39

+ 297 - 169
apt-pkg/acquire-item.cc

@@ -330,7 +330,7 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner,
 
    RealURI = Target->URI;
    Desc.Owner = this;
-   Desc.Description = Target->Description + "/DiffIndex";
+   Desc.Description = Target->Description + ".diff/Index";
    Desc.ShortDesc = Target->ShortDesc;
    Desc.URI = Target->URI + ".diff/Index";
 
@@ -350,9 +350,7 @@ pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner,
       Desc.URI.substr(0,strlen("file:/")) == "file:/")
    {
       // we don't have a pkg file or we don't want to queue
-      if(Debug)
-	 std::clog << "No index file, local or canceld by user" << std::endl;
-      Failed("", NULL);
+      Failed("No index file, local or canceld by user", NULL);
       return;
    }
 
@@ -371,7 +369,7 @@ string pkgAcqDiffIndex::Custom600Headers() const
 {
    string Final = _config->FindDir("Dir::State::lists");
    Final += URItoFileName(Desc.URI);
-   
+
    if(Debug)
       std::clog << "Custom600Header-IMS: " << Final << std::endl;
 
@@ -384,178 +382,284 @@ string pkgAcqDiffIndex::Custom600Headers() const
 									/*}}}*/
 bool pkgAcqDiffIndex::ParseDiffIndex(string IndexDiffFile)		/*{{{*/
 {
+   // failing here is fine: our caller will take care of trying to
+   // get the complete file if patching fails
    if(Debug)
       std::clog << "pkgAcqDiffIndex::ParseIndexDiff() " << IndexDiffFile
 	 << std::endl;
 
-   pkgTagSection Tags;
-   string ServerSha1;
-   vector<DiffInfo> available_patches;
-   
    FileFd Fd(IndexDiffFile,FileFd::ReadOnly);
    pkgTagFile TF(&Fd);
    if (_error->PendingError() == true)
       return false;
 
-   if(TF.Step(Tags) == true)
+   pkgTagSection Tags;
+   if(unlikely(TF.Step(Tags) == false))
+      return false;
+
+   HashStringList ServerHashes;
+   unsigned long long ServerSize = 0;
+
+   for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type)
    {
-      bool found = false;
-      DiffInfo d;
-      string size;
+      std::string tagname = *type;
+      tagname.append("-Current");
+      std::string const tmp = Tags.FindS(tagname.c_str());
+      if (tmp.empty() == true)
+	 continue;
 
-      string const tmp = Tags.FindS("SHA1-Current");
+      string hash;
+      unsigned long long size;
       std::stringstream ss(tmp);
-      ss >> ServerSha1 >> size;
-      unsigned long const ServerSize = atol(size.c_str());
+      ss >> hash >> size;
+      if (unlikely(hash.empty() == true))
+	 continue;
+      if (unlikely(ServerSize != 0 && ServerSize != size))
+	 continue;
+      ServerHashes.push_back(HashString(*type, hash));
+      ServerSize = size;
+   }
 
-      FileFd fd(CurrentPackagesFile, FileFd::ReadOnly);
-      SHA1Summation SHA1;
-      SHA1.AddFD(fd);
-      string const local_sha1 = SHA1.Result();
+   if (ServerHashes.usable() == false)
+   {
+      if (Debug == true)
+	 std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": Did not find a good hashsum in the index" << std::endl;
+      return false;
+   }
 
-      if(local_sha1 == ServerSha1)
+   if (ServerHashes != HashSums())
+   {
+      if (Debug == true)
       {
-	 // we have the same sha1 as the server so we are done here
-	 if(Debug)
-	    std::clog << "Package file is up-to-date" << std::endl;
-         // ensure we have no leftovers from previous runs
-         std::string Partial = _config->FindDir("Dir::State::lists");
-         Partial += "partial/" + URItoFileName(RealURI);
-         unlink(Partial.c_str());
-	 // list cleanup needs to know that this file as well as the already
-	 // present index is ours, so we create an empty diff to save it for us
-	 new pkgAcqIndexDiffs(Owner, TransactionManager, Target, 
-                              ExpectedHashes, MetaIndexParser, 
-                              ServerSha1, available_patches);
-	 return true;
+	 std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": Index has different hashes than parser, probably older, so fail pdiffing" << std::endl;
+         printHashSumComparision(CurrentPackagesFile, ServerHashes, HashSums());
       }
-      else
+      return false;
+   }
+
+   if (ServerHashes.VerifyFile(CurrentPackagesFile) == true)
+   {
+      // we have the same sha1 as the server so we are done here
+      if(Debug)
+	 std::clog << "pkgAcqDiffIndex: Package file " << CurrentPackagesFile << " is up-to-date" << std::endl;
+
+      // list cleanup needs to know that this file as well as the already
+      // present index is ours, so we create an empty diff to save it for us
+      new pkgAcqIndexDiffs(Owner, TransactionManager, Target,
+                           ExpectedHashes, MetaIndexParser);
+      return true;
+   }
+
+   FileFd fd(CurrentPackagesFile, FileFd::ReadOnly);
+   Hashes LocalHashesCalc;
+   LocalHashesCalc.AddFD(fd);
+   HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList();
+
+   if(Debug)
+      std::clog << "Server-Current: " << ServerHashes.find(NULL)->toStr() << " and we start at "
+	 << fd.Name() << " " << fd.FileSize() << " " << LocalHashes.find(NULL)->toStr() << std::endl;
+
+   // parse all of (provided) history
+   vector<DiffInfo> available_patches;
+   bool firstAcceptedHashes = true;
+   for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type)
+   {
+      if (LocalHashes.find(*type) == NULL)
+	 continue;
+
+      std::string tagname = *type;
+      tagname.append("-History");
+      std::string const tmp = Tags.FindS(tagname.c_str());
+      if (tmp.empty() == true)
+	 continue;
+
+      string hash, filename;
+      unsigned long long size;
+      std::stringstream ss(tmp);
+
+      while (ss >> hash >> size >> filename)
       {
-	 if(Debug)
-	    std::clog << "SHA1-Current: " << ServerSha1 << " and we start at "<< fd.Name() << " " << fd.Size() << " " << local_sha1 << std::endl;
+	 if (unlikely(hash.empty() == true || filename.empty() == true))
+	    continue;
 
-	 // check the historie and see what patches we need
-	 string const history = Tags.FindS("SHA1-History");
-	 std::stringstream hist(history);
-	 while(hist >> d.sha1 >> size >> d.file)
+	 // see if we have a record for this file already
+	 std::vector<DiffInfo>::iterator cur = available_patches.begin();
+	 for (; cur != available_patches.end(); ++cur)
 	 {
-	    // read until the first match is found
-	    // from that point on, we probably need all diffs
-	    if(d.sha1 == local_sha1) 
-	       found=true;
-	    else if (found == false)
+	    if (cur->file != filename || unlikely(cur->result_size != size))
 	       continue;
-
-	    if(Debug)
-	       std::clog << "Need to get diff: " << d.file << std::endl;
-	    available_patches.push_back(d);
+	    cur->result_hashes.push_back(HashString(*type, hash));
+	    break;
 	 }
-
-	 if (available_patches.empty() == false)
+	 if (cur != available_patches.end())
+	    continue;
+	 if (firstAcceptedHashes == true)
+	 {
+	    DiffInfo next;
+	    next.file = filename;
+	    next.result_hashes.push_back(HashString(*type, hash));
+	    next.result_size = size;
+	    next.patch_size = 0;
+	    available_patches.push_back(next);
+	 }
+	 else
 	 {
-	    // patching with too many files is rather slow compared to a fast download
-	    unsigned long const fileLimit = _config->FindI("Acquire::PDiffs::FileLimit", 0);
-	    if (fileLimit != 0 && fileLimit < available_patches.size())
-	    {
-	       if (Debug)
-		  std::clog << "Need " << available_patches.size() << " diffs (Limit is " << fileLimit
-			<< ") so fallback to complete download" << std::endl;
-	       return false;
-	    }
-
-	    // see if the patches are too big
-	    found = false; // it was true and it will be true again at the end
-	    d = *available_patches.begin();
-	    string const firstPatch = d.file;
-	    unsigned long patchesSize = 0;
-	    std::stringstream patches(Tags.FindS("SHA1-Patches"));
-	    while(patches >> d.sha1 >> size >> d.file)
-	    {
-	       if (firstPatch == d.file)
-		  found = true;
-	       else if (found == false)
-		  continue;
-
-	       patchesSize += atol(size.c_str());
-	    }
-	    unsigned long const sizeLimit = ServerSize * _config->FindI("Acquire::PDiffs::SizeLimit", 100);
-	    if (sizeLimit > 0 && (sizeLimit/100) < patchesSize)
-	    {
-	       if (Debug)
-		  std::clog << "Need " << patchesSize << " bytes (Limit is " << sizeLimit/100
-			<< ") so fallback to complete download" << std::endl;
-	       return false;
-	    }
+	    if (Debug == true)
+	       std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename
+		  << " wasn't in the list for the first parsed hash! (history)" << std::endl;
+	    break;
 	 }
       }
+      firstAcceptedHashes = false;
+   }
+
+   if (unlikely(available_patches.empty() == true))
+   {
+      if (Debug)
+	 std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": "
+	    << "Couldn't find any patches for the patch series." << std::endl;
+      return false;
+   }
 
-      // we have something, queue the next diff
-      if(found)
+   for (char const * const * type = HashString::SupportedHashes(); *type != NULL; ++type)
+   {
+      if (LocalHashes.find(*type) == NULL)
+	 continue;
+
+      std::string tagname = *type;
+      tagname.append("-Patches");
+      std::string const tmp = Tags.FindS(tagname.c_str());
+      if (tmp.empty() == true)
+	 continue;
+
+      string hash, filename;
+      unsigned long long size;
+      std::stringstream ss(tmp);
+
+      while (ss >> hash >> size >> filename)
       {
-         // FIXME: make this use the method
-         PackagesFileReadyInPartial = true;
-	 std::string const Partial = GetPartialFileNameFromURI(RealURI);
-
-         FileFd From(CurrentPackagesFile, FileFd::ReadOnly);
-         FileFd To(Partial, FileFd::WriteEmpty);
-         if(CopyFile(From, To) == false)
-            return _error->Errno("CopyFile", "failed to copy");
-
-         if(Debug)
-            std::cerr << "Done copying " << CurrentPackagesFile
-                      << " -> " << Partial
-                      << std::endl;
+	 if (unlikely(hash.empty() == true || filename.empty() == true))
+	    continue;
 
-	 // queue the diffs
-	 string::size_type const last_space = Description.rfind(" ");
-	 if(last_space != string::npos)
-	    Description.erase(last_space, Description.size()-last_space);
-
-	 /* decide if we should download patches one by one or in one go:
-	    The first is good if the server merges patches, but many don't so client
-	    based merging can be attempt in which case the second is better.
-	    "bad things" will happen if patches are merged on the server,
-	    but client side merging is attempt as well */
-	 bool pdiff_merge = _config->FindB("Acquire::PDiffs::Merge", true);
-	 if (pdiff_merge == true)
+	 // see if we have a record for this file already
+	 std::vector<DiffInfo>::iterator cur = available_patches.begin();
+	 for (; cur != available_patches.end(); ++cur)
 	 {
-	    // reprepro adds this flag if it has merged patches on the server
-	    std::string const precedence = Tags.FindS("X-Patch-Precedence");
-	    pdiff_merge = (precedence != "merged");
+	    if (cur->file != filename)
+	       continue;
+	    if (unlikely(cur->patch_size != 0 && cur->patch_size != size))
+	       continue;
+	    cur->patch_hashes.push_back(HashString(*type, hash));
+	    cur->patch_size = size;
+	    break;
 	 }
+	 if (cur != available_patches.end())
+	       continue;
+	 if (Debug == true)
+	    std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": File " << filename
+	       << " wasn't in the list for the first parsed hash! (patches)" << std::endl;
+	 break;
+      }
+   }
 
-	 if (pdiff_merge == false)
-         {
-	    new pkgAcqIndexDiffs(Owner, TransactionManager, Target, ExpectedHashes, 
-                                 MetaIndexParser,
-                                 ServerSha1, available_patches);
-         }
-         else
-	 {
-	    std::vector<pkgAcqIndexMergeDiffs*> *diffs = new std::vector<pkgAcqIndexMergeDiffs*>(available_patches.size());
-	    for(size_t i = 0; i < available_patches.size(); ++i)
-	       (*diffs)[i] = new pkgAcqIndexMergeDiffs(Owner,
-                                                       TransactionManager,
-                                                       Target,
-                                                       ExpectedHashes,
-                                                       MetaIndexParser,
-                                                       available_patches[i],
-                                                       diffs);
-	 }
+   bool foundStart = false;
+   for (std::vector<DiffInfo>::iterator cur = available_patches.begin();
+	 cur != available_patches.end(); ++cur)
+   {
+      if (LocalHashes != cur->result_hashes)
+	 continue;
 
-         Complete = false;
-         Status = StatDone;
-         Dequeue();
-         return true;
-      }
+      available_patches.erase(available_patches.begin(), cur);
+      foundStart = true;
+      break;
    }
+
+   if (foundStart == false || unlikely(available_patches.empty() == true))
+   {
+      if (Debug)
+	 std::clog << "pkgAcqDiffIndex: " << IndexDiffFile << ": "
+	    << "Couldn't find the start of the patch series." << std::endl;
+      return false;
+   }
+
+   // patching with too many files is rather slow compared to a fast download
+   unsigned long const fileLimit = _config->FindI("Acquire::PDiffs::FileLimit", 0);
+   if (fileLimit != 0 && fileLimit < available_patches.size())
+   {
+      if (Debug)
+	 std::clog << "Need " << available_patches.size() << " diffs (Limit is " << fileLimit
+	    << ") so fallback to complete download" << std::endl;
+      return false;
+   }
+
+   // calculate the size of all patches we have to get
+   // note that all sizes are uncompressed, while we download compressed files
+   unsigned long long patchesSize = 0;
+   for (std::vector<DiffInfo>::const_iterator cur = available_patches.begin();
+	 cur != available_patches.end(); ++cur)
+      patchesSize += cur->patch_size;
+   unsigned long long const sizeLimit = ServerSize * _config->FindI("Acquire::PDiffs::SizeLimit", 100);
+   if (false && sizeLimit > 0 && (sizeLimit/100) < patchesSize)
+   {
+      if (Debug)
+	 std::clog << "Need " << patchesSize << " bytes (Limit is " << sizeLimit/100
+	    << ") so fallback to complete download" << std::endl;
+      return false;
+   }
+
+   // FIXME: make this use the method
+   PackagesFileReadyInPartial = true;
+   std::string const Partial = GetPartialFileNameFromURI(RealURI);
+   
+   FileFd From(CurrentPackagesFile, FileFd::ReadOnly);
+   FileFd To(Partial, FileFd::WriteEmpty);
+   if(CopyFile(From, To) == false)
+      return _error->Errno("CopyFile", "failed to copy");
    
-   // Nothing found, report and return false
-   // Failing here is ok, if we return false later, the full
-   // IndexFile is queued
    if(Debug)
-      std::clog << "Can't find a patch in the index file" << std::endl;
-   return false;
+      std::cerr << "Done copying " << CurrentPackagesFile
+                << " -> " << Partial
+                << std::endl;
+
+   // we have something, queue the diffs
+   string::size_type const last_space = Description.rfind(" ");
+   if(last_space != string::npos)
+      Description.erase(last_space, Description.size()-last_space);
+
+   /* decide if we should download patches one by one or in one go:
+      The first is good if the server merges patches, but many don't so client
+      based merging can be attempt in which case the second is better.
+      "bad things" will happen if patches are merged on the server,
+      but client side merging is attempt as well */
+   bool pdiff_merge = _config->FindB("Acquire::PDiffs::Merge", true);
+   if (pdiff_merge == true)
+   {
+      // reprepro adds this flag if it has merged patches on the server
+      std::string const precedence = Tags.FindS("X-Patch-Precedence");
+      pdiff_merge = (precedence != "merged");
+   }
+
+   if (pdiff_merge == false)
+   {
+      new pkgAcqIndexDiffs(Owner, TransactionManager, Target, ExpectedHashes, 
+                           MetaIndexParser, available_patches);
+   }
+   else
+   {
+      std::vector<pkgAcqIndexMergeDiffs*> *diffs = new std::vector<pkgAcqIndexMergeDiffs*>(available_patches.size());
+      for(size_t i = 0; i < available_patches.size(); ++i)
+	 (*diffs)[i] = new pkgAcqIndexMergeDiffs(Owner, TransactionManager,
+               Target,
+	       ExpectedHashes,
+	       MetaIndexParser,
+	       available_patches[i],
+	       diffs);
+   }
+
+   Complete = false;
+   Status = StatDone;
+   Dequeue();
+   return true;
 }
 									/*}}}*/
 void pkgAcqDiffIndex::Failed(string Message,pkgAcquire::MethodConfig * Cnf)/*{{{*/
@@ -593,13 +697,17 @@ void pkgAcqDiffIndex::Done(string Message,unsigned long long Size,HashStringList
 
    }
 
+   string FinalFile;
+   FinalFile = _config->FindDir("Dir::State::lists");
+   FinalFile += URItoFileName(Desc.URI);
+
+   if(StringToBool(LookupTag(Message,"IMS-Hit"),false))
+      DestFile = FinalFile;
+
    if(!ParseDiffIndex(DestFile))
       return Failed("Message: Couldn't parse pdiff index", Cnf);
 
    // queue for final move
-   string FinalFile;
-   FinalFile = _config->FindDir("Dir::State::lists")+URItoFileName(RealURI);
-   FinalFile += string(".IndexDiff");
    TransactionManager->TransactionStageCopy(this, DestFile, FinalFile);
 
    Complete = true;
@@ -618,10 +726,9 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
                                    struct IndexTarget const * const Target,
                                    HashStringList const &ExpectedHashes,
                                    indexRecords *MetaIndexParser,
-				   string ServerSha1,
 				   vector<DiffInfo> diffs)
    : pkgAcqBaseIndex(Owner, TransactionManager, Target, ExpectedHashes, MetaIndexParser),
-     available_patches(diffs), ServerSha1(ServerSha1)
+     available_patches(diffs)
 {
    DestFile = GetPartialFileNameFromURI(Target->URI);
 
@@ -676,16 +783,9 @@ void pkgAcqIndexDiffs::Finish(bool allDone)
       }
 
       // queue for copy
-      PartialFile = GetPartialFileNameFromURI(RealURI);
-
-      DestFile = _config->FindDir("Dir::State::lists");
-      DestFile += URItoFileName(RealURI);
-
-      // this happens if we have a up-to-date indexfile
-      if(!FileExists(PartialFile))
-         PartialFile = DestFile;
-
-      TransactionManager->TransactionStageCopy(this, PartialFile, DestFile);
+      std::string FinalFile = _config->FindDir("Dir::State::lists");
+      FinalFile += URItoFileName(RealURI);
+      TransactionManager->TransactionStageCopy(this, DestFile, FinalFile);
 
       // this is for the "real" finish
       Complete = true;
@@ -716,16 +816,22 @@ bool pkgAcqIndexDiffs::QueueNextDiff()					/*{{{*/
    }
 
    FileFd fd(FinalFile, FileFd::ReadOnly);
-   SHA1Summation SHA1;
-   SHA1.AddFD(fd);
-   string local_sha1 = string(SHA1.Result());
+   Hashes LocalHashesCalc;
+   LocalHashesCalc.AddFD(fd);
+   HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList();
+
    if(Debug)
-      std::clog << "QueueNextDiff: " 
-		<< FinalFile << " (" << local_sha1 << ")"<<std::endl;
+      std::clog << "QueueNextDiff: " << FinalFile << " (" << LocalHashes.find(NULL)->toStr() << ")" << std::endl;
+
+   if (unlikely(LocalHashes.usable() == false || ExpectedHashes.usable() == false))
+   {
+      Failed("Local/Expected hashes are not usable", NULL);
+      return false;
+   }
 
 
    // final file reached before all patches are applied
-   if(local_sha1 == ServerSha1)
+   if(LocalHashes == ExpectedHashes)
    {
       Finish(true);
       return true;
@@ -733,10 +839,10 @@ bool pkgAcqIndexDiffs::QueueNextDiff()					/*{{{*/
 
    // remove all patches until the next matching patch is found
    // this requires the Index file to be ordered
-   for(vector<DiffInfo>::iterator I=available_patches.begin();
+   for(vector<DiffInfo>::iterator I = available_patches.begin();
        available_patches.empty() == false &&
 	  I != available_patches.end() &&
-	  I->sha1 != local_sha1;
+	  I->result_hashes != LocalHashes;
        ++I)
    {
       available_patches.erase(I);
@@ -745,7 +851,7 @@ bool pkgAcqIndexDiffs::QueueNextDiff()					/*{{{*/
    // error checking and falling back if no patch was found
    if(available_patches.empty() == true)
    {
-      Failed("Message: No patches available", NULL);
+      Failed("No patches left to reach target", NULL);
       return false;
    }
 
@@ -756,7 +862,7 @@ bool pkgAcqIndexDiffs::QueueNextDiff()					/*{{{*/
 
    if(Debug)
       std::clog << "pkgAcqIndexDiffs::QueueNextDiff(): " << Desc.URI << std::endl;
-   
+
    QueueURI(Desc);
 
    return true;
@@ -776,6 +882,17 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size, HashStringLi
    // success in downloading a diff, enter ApplyDiff state
    if(State == StateFetchDiff)
    {
+      FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip);
+      class Hashes LocalHashesCalc;
+      LocalHashesCalc.AddFD(fd);
+      HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList();
+
+      if (fd.Size() != available_patches[0].patch_size ||
+	    available_patches[0].patch_hashes != LocalHashes)
+      {
+	 Failed("Patch has Size/Hashsum mismatch", NULL);
+	 return;
+      }
 
       // rred excepts the patch as $FinalFile.ed
       Rename(DestFile,FinalFile+".ed");
@@ -812,7 +929,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size, HashStringLi
       if(available_patches.empty() == false) {
 	 new pkgAcqIndexDiffs(Owner, TransactionManager, Target,
 			      ExpectedHashes, MetaIndexParser,
-                              ServerSha1, available_patches);
+			      available_patches);
 	 return Finish();
       } else 
          // update
@@ -884,6 +1001,17 @@ void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,HashStri
 
    if (State == StateFetchDiff)
    {
+      FileFd fd(DestFile, FileFd::ReadOnly, FileFd::Gzip);
+      class Hashes LocalHashesCalc;
+      LocalHashesCalc.AddFD(fd);
+      HashStringList const LocalHashes = LocalHashesCalc.GetHashStringList();
+
+      if (fd.Size() != patch.patch_size || patch.patch_hashes != LocalHashes)
+      {
+	 Failed("Patch has Size/Hashsum mismatch", NULL);
+	 return;
+      }
+
       // rred expects the patch as $FinalFile.ed.$patchname.gz
       Rename(DestFile, FinalFile + ".ed." + patch.file + ".gz");
 

+ 13 - 13
apt-pkg/acquire-item.h

@@ -343,11 +343,17 @@ struct DiffInfo {
    /** The filename of the diff. */
    std::string file;
 
-   /** The sha1 hash of the diff. */
-   std::string sha1;
+   /** The hashes of the diff */
+   HashStringList result_hashes;
 
-   /** The size of the diff. */
-   unsigned long size;
+   /** The hashes of the file after the diff is applied */
+   HashStringList patch_hashes;
+
+   /** The size of the file after the diff is applied */
+   unsigned long long result_size;
+
+   /** The size of the diff itself */
+   unsigned long long patch_size;
 };
 									/*}}}*/
 									/*}}}*/
@@ -817,7 +823,7 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
     *  \return \b true if an applicable diff was found, \b false
     *  otherwise.
     */
-   bool QueueNextDiff();
+   APT_HIDDEN bool QueueNextDiff();
 
    /** \brief Handle tasks that must be performed after the item
     *  finishes downloading.
@@ -830,7 +836,7 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
     *  \param allDone If \b true, the file was entirely reconstructed,
     *  and its md5sum is verified. 
     */
-   void Finish(bool allDone=false);
+   APT_HIDDEN void Finish(bool allDone=false);
 
    protected:
 
@@ -852,9 +858,6 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
     */
    std::vector<DiffInfo> available_patches;
 
-   /** Stop applying patches when reaching that sha1 */
-   std::string ServerSha1;
-
    /** The current status of this patch. */
    enum DiffState
      {
@@ -898,12 +901,10 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
     *
     *  \param ShortDesc A brief description of this item.
     *
-    *  \param ExpectedHashes The expected md5sum of the completely
+    *  \param ExpectedHashes The expected hashsums of the completely
     *  reconstructed package index file; the index file will be tested
     *  against this value when it is entirely reconstructed.
     *
-    *  \param ServerSha1 is the sha1sum of the current file on the server
-    *
     *  \param diffs The remaining diffs from the index of diffs.  They
     *  should be ordered so that each diff appears before any diff
     *  that depends on it.
@@ -913,7 +914,6 @@ class pkgAcqIndexDiffs : public pkgAcqBaseIndex
                     struct IndexTarget const * const Target,
                     HashStringList const &ExpectedHash,
                     indexRecords *MetaIndexParser,
-		    std::string ServerSha1,
 		    std::vector<DiffInfo> diffs=std::vector<DiffInfo>());
 };
 									/*}}}*/

+ 9 - 9
apt-pkg/algorithms.h

@@ -82,9 +82,9 @@ class pkgSimulate : public pkgPackageManager				/*{{{*/
    virtual bool Remove(PkgIterator Pkg,bool Purge);
 
 private:
-   void ShortBreaks();
-   void Describe(PkgIterator iPkg,std::ostream &out,bool Current,bool Candidate);
-   
+   APT_HIDDEN void ShortBreaks();
+   APT_HIDDEN void Describe(PkgIterator iPkg,std::ostream &out,bool Current,bool Candidate);
+
    public:
 
    pkgSimulate(pkgDepCache *Cache);
@@ -114,7 +114,7 @@ class pkgProblemResolver						/*{{{*/
    
    // Sort stuff
    static pkgProblemResolver *This;
-   static int ScoreSort(const void *a,const void *b) APT_PURE;
+   APT_HIDDEN static int ScoreSort(const void *a,const void *b) APT_PURE;
 
    struct PackageKill
    {
@@ -122,12 +122,12 @@ class pkgProblemResolver						/*{{{*/
       DepIterator Dep;
    };
 
-   void MakeScores();
-   bool DoUpgrade(pkgCache::PkgIterator Pkg);
+   APT_HIDDEN void MakeScores();
+   APT_HIDDEN bool DoUpgrade(pkgCache::PkgIterator Pkg);
+
+   APT_HIDDEN bool ResolveInternal(bool const BrokenFix = false);
+   APT_HIDDEN bool ResolveByKeepInternal();
 
-   bool ResolveInternal(bool const BrokenFix = false);
-   bool ResolveByKeepInternal();
-   
    protected:
    bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg);
 

+ 29 - 29
apt-pkg/aptconfiguration.cc

@@ -32,6 +32,35 @@
 #include <apti18n.h>
 									/*}}}*/
 namespace APT {
+// setDefaultConfigurationForCompressors				/*{{{*/
+static void setDefaultConfigurationForCompressors() {
+	// Set default application paths to check for optional compression types
+	_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
+	_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
+	if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
+		_config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
+		_config->Set("APT::Compressor::lzma::Binary", "xz");
+		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
+			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
+		}
+		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma");
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
+		}
+	} else {
+		_config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
+		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
+			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
+		}
+		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix=");
+			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
+		}
+	}
+}
+									/*}}}*/
 // getCompressionTypes - Return Vector of usable compressiontypes	/*{{{*/
 // ---------------------------------------------------------------------
 /* return a vector of compression types in the preferred order. */
@@ -402,35 +431,6 @@ bool Configuration::checkArchitecture(std::string const &Arch) {
 	return (std::find(archs.begin(), archs.end(), Arch) != archs.end());
 }
 									/*}}}*/
-// setDefaultConfigurationForCompressors				/*{{{*/
-void Configuration::setDefaultConfigurationForCompressors() {
-	// Set default application paths to check for optional compression types
-	_config->CndSet("Dir::Bin::bzip2", "/bin/bzip2");
-	_config->CndSet("Dir::Bin::xz", "/usr/bin/xz");
-	if (FileExists(_config->FindFile("Dir::Bin::xz")) == true) {
-		_config->Set("Dir::Bin::lzma", _config->FindFile("Dir::Bin::xz"));
-		_config->Set("APT::Compressor::lzma::Binary", "xz");
-		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::CompressArg::", "--format=lzma");
-			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
-		}
-		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "--format=lzma");
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
-		}
-	} else {
-		_config->CndSet("Dir::Bin::lzma", "/usr/bin/lzma");
-		if (_config->Exists("APT::Compressor::lzma::CompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::CompressArg::", "--suffix=");
-			_config->Set("APT::Compressor::lzma::CompressArg::", "-9");
-		}
-		if (_config->Exists("APT::Compressor::lzma::UncompressArg") == false) {
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "--suffix=");
-			_config->Set("APT::Compressor::lzma::UncompressArg::", "-d");
-		}
-	}
-}
-									/*}}}*/
 // getCompressors - Return Vector of usealbe compressors		/*{{{*/
 // ---------------------------------------------------------------------
 /* return a vector of compressors used by apt-ftparchive in the

+ 0 - 3
apt-pkg/aptconfiguration.h

@@ -123,9 +123,6 @@ public:									/*{{{*/
 	/** \return Return a comma-separated list of enabled build profile specifications */
 	std::string static const getBuildProfilesString();
 									/*}}}*/
-	private:							/*{{{*/
-	void static setDefaultConfigurationForCompressors();
-									/*}}}*/
 };
 									/*}}}*/
 }

+ 8 - 8
apt-pkg/cacheset.h

@@ -574,21 +574,21 @@ template<> template<class Compare> inline bool PackageContainer<std::vector<pkgC
 
     The wrapping is read-only in practice modeled by making erase and co
     private methods. */
-class PackageUniverse : public PackageContainerInterface {
+class APT_HIDDEN PackageUniverse : public PackageContainerInterface {
 	pkgCache * const _cont;
 public:
 	typedef pkgCache::PkgIterator iterator;
 	typedef pkgCache::PkgIterator const_iterator;
 
-	bool empty() const { return false; }
-	size_t size() const { return _cont->Head().PackageCount; }
+	APT_PUBLIC bool empty() const { return false; }
+	APT_PUBLIC size_t size() const { return _cont->Head().PackageCount; }
 
-	const_iterator begin() const { return _cont->PkgBegin(); }
-	const_iterator end() const { return  _cont->PkgEnd(); }
-	iterator begin() { return _cont->PkgBegin(); }
-	iterator end() { return _cont->PkgEnd(); }
+	APT_PUBLIC const_iterator begin() const { return _cont->PkgBegin(); }
+	APT_PUBLIC const_iterator end() const { return  _cont->PkgEnd(); }
+	APT_PUBLIC iterator begin() { return _cont->PkgBegin(); }
+	APT_PUBLIC iterator end() { return _cont->PkgEnd(); }
 
-	PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
+	APT_PUBLIC PackageUniverse(pkgCache * const Owner) : _cont(Owner) { }
 
 private:
 	bool insert(pkgCache::PkgIterator const &) { return true; }

+ 0 - 5
apt-pkg/contrib/configuration.cc

@@ -253,11 +253,6 @@ string Configuration::FindDir(const char *Name,const char *Default) const
 // Configuration::FindVector - Find a vector of values			/*{{{*/
 // ---------------------------------------------------------------------
 /* Returns a vector of config values under the given item */
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
-vector<string> Configuration::FindVector(const char *Name) const { 
-   return FindVector(Name, ""); 
-}
-#endif
 vector<string> Configuration::FindVector(const char *Name, std::string const &Default) const
 {
    vector<string> Vec;

+ 6 - 8
apt-pkg/contrib/configuration.h

@@ -34,6 +34,8 @@
 #include <vector>
 #include <iostream>
 
+#include <apt-pkg/macros.h>
+
 #ifndef APT_8_CLEANER_HEADERS
 using std::string;
 #endif
@@ -59,7 +61,7 @@ class Configuration
    
    Item *Root;
    bool ToFree;
-   
+
    Item *Lookup(Item *Head,const char *S,unsigned long const &Len,bool const &Create);
    Item *Lookup(const char *Name,const bool &Create);
    inline const Item *Lookup(const char *Name) const
@@ -82,12 +84,8 @@ class Configuration
     *
     * \param Name of the parent node
     * \param Default list of values separated by commas */
-   std::vector<std::string> FindVector(const char *Name, std::string const &Default) const;
-   std::vector<std::string> FindVector(std::string const &Name, std::string const &Default) const { return FindVector(Name.c_str(), Default); };
-#if (APT_PKG_MAJOR >= 4 && APT_PKG_MINOR < 13)
-   std::vector<std::string> FindVector(const char *Name) const;
-#endif
-   std::vector<std::string> FindVector(std::string const &Name="") const { return FindVector(Name.c_str(), ""); };
+   std::vector<std::string> FindVector(const char *Name, std::string const &Default = "") const;
+   std::vector<std::string> FindVector(std::string const &Name, std::string const &Default = "") const { return FindVector(Name.c_str(), Default); };
    int FindI(const char *Name,int const &Default = 0) const;
    int FindI(std::string const &Name,int const &Default = 0) const {return FindI(Name.c_str(),Default);};
    bool FindB(const char *Name,bool const &Default = false) const;
@@ -127,7 +125,7 @@ class Configuration
    class MatchAgainstConfig
    {
      std::vector<regex_t *> patterns;
-     void clearPatterns();
+     APT_HIDDEN void clearPatterns();
 
    public:
      MatchAgainstConfig(char const * Config);

+ 2 - 2
apt-pkg/contrib/hashes.cc

@@ -209,11 +209,11 @@ bool HashStringList::operator==(HashStringList const &other) const	/*{{{*/
    std::string const forcedType = _config->Find("Acquire::ForceHash", "");
    if (forcedType.empty() == false)
    {
-      HashString const * const hs = other.find(forcedType);
+      HashString const * const hs = find(forcedType);
       HashString const * const ohs = other.find(forcedType);
       if (hs == NULL || ohs == NULL)
 	 return false;
-      return hs == ohs;
+      return *hs == *ohs;
    }
    short matches = 0;
    for (const_iterator hs = begin(); hs != end(); ++hs)

+ 1 - 1
apt-pkg/contrib/macros.h

@@ -138,7 +138,7 @@
 // Non-ABI-Breaks should only increase RELEASE number.
 // See also buildlib/libversion.mak
 #define APT_PKG_MAJOR 4
-#define APT_PKG_MINOR 13
+#define APT_PKG_MINOR 14
 #define APT_PKG_RELEASE 0
 
 #endif

+ 2 - 2
apt-pkg/contrib/strutl.h

@@ -153,9 +153,9 @@ inline const char *DeNull(const char *s) {return (s == 0?"(null)":s);}
 class URI
 {
    void CopyFrom(const std::string &From);
-		 
+
    public:
-   
+
    std::string Access;
    std::string User;
    std::string Password;

+ 3 - 3
apt-pkg/deb/debindexfile.cc

@@ -131,7 +131,7 @@ string debSourcesIndex::Info(const char *Type) const
 // SourcesIndex::Index* - Return the URI to the index files		/*{{{*/
 // ---------------------------------------------------------------------
 /* */
-inline string debSourcesIndex::IndexFile(const char *Type) const
+string debSourcesIndex::IndexFile(const char *Type) const
 {
    string s = URItoFileName(IndexURI(Type));
 
@@ -265,7 +265,7 @@ string debPackagesIndex::Info(const char *Type) const
 // PackagesIndex::Index* - Return the URI to the index files		/*{{{*/
 // ---------------------------------------------------------------------
 /* */
-inline string debPackagesIndex::IndexFile(const char *Type) const
+string debPackagesIndex::IndexFile(const char *Type) const
 {
    string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
 
@@ -421,7 +421,7 @@ debTranslationsIndex::debTranslationsIndex(string URI,string Dist,string Section
 // TranslationIndex::Trans* - Return the URI to the translation files	/*{{{*/
 // ---------------------------------------------------------------------
 /* */
-inline string debTranslationsIndex::IndexFile(const char *Type) const
+string debTranslationsIndex::IndexFile(const char *Type) const
 {
    string s =_config->FindDir("Dir::State::lists") + URItoFileName(IndexURI(Type));
 

+ 13 - 12
apt-pkg/deb/debindexfile.h

@@ -65,10 +65,10 @@ class debPackagesIndex : public pkgIndexFile
    std::string Section;
    std::string Architecture;
 
-   std::string Info(const char *Type) const;
-   std::string IndexFile(const char *Type) const;
-   std::string IndexURI(const char *Type) const;
-   
+   APT_HIDDEN std::string Info(const char *Type) const;
+   APT_HIDDEN std::string IndexFile(const char *Type) const;
+   APT_HIDDEN std::string IndexURI(const char *Type) const;
+
    public:
    
    virtual const Type *GetType() const APT_CONST;
@@ -102,11 +102,11 @@ class debTranslationsIndex : public pkgIndexFile
    std::string Section;
    const char * const Language;
    
-   std::string Info(const char *Type) const;
-   std::string IndexFile(const char *Type) const;
-   std::string IndexURI(const char *Type) const;
+   APT_HIDDEN std::string Info(const char *Type) const;
+   APT_HIDDEN std::string IndexFile(const char *Type) const;
+   APT_HIDDEN std::string IndexURI(const char *Type) const;
 
-   inline std::string TranslationFile() const {return std::string("Translation-").append(Language);};
+   APT_HIDDEN std::string TranslationFile() const {return std::string("Translation-").append(Language);};
 
    public:
    
@@ -136,10 +136,10 @@ class debSourcesIndex : public pkgIndexFile
    std::string Dist;
    std::string Section;
 
-   std::string Info(const char *Type) const;
-   std::string IndexFile(const char *Type) const;
-   std::string IndexURI(const char *Type) const;
-   
+   APT_HIDDEN std::string Info(const char *Type) const;
+   APT_HIDDEN std::string IndexFile(const char *Type) const;
+   APT_HIDDEN std::string IndexURI(const char *Type) const;
+
    public:
 
    virtual const Type *GetType() const APT_CONST;
@@ -214,6 +214,7 @@ class debDscFileIndex : public pkgIndexFile
 
 class debDebianSourceDirIndex : public debDscFileIndex
 {
+ public:
    virtual const Type *GetType() const APT_CONST;
 };
 

+ 2 - 2
apt-pkg/deb/deblistparser.cc

@@ -162,7 +162,7 @@ bool debListParser::NewVersion(pkgCache::VerIterator &Ver)
 	       std::string const version(Open + 1, (Close - Open) - 1);
 	       if (version != Ver.VerStr())
 	       {
-		  map_stringitem_t const idx = StoreString(pkgCacheGenerator::VERSION, version);
+		  map_stringitem_t const idx = StoreString(pkgCacheGenerator::VERSIONNUMBER, version);
 		  Ver->SourceVerStr = idx;
 	       }
 	    }
@@ -953,7 +953,7 @@ bool debListParser::LoadReleaseInfo(pkgCache::PkgFileIterator &FileI,
    }
    APT_INRELEASE(MIXED, "Suite", FileI->Archive)
    APT_INRELEASE(MIXED, "Component", FileI->Component)
-   APT_INRELEASE(VERSION, "Version", FileI->Version)
+   APT_INRELEASE(VERSIONNUMBER, "Version", FileI->Version)
    APT_INRELEASE(MIXED, "Origin", FileI->Origin)
    APT_INRELEASE(MIXED, "Codename", FileI->Codename)
    APT_INRELEASE(MIXED, "Label", FileI->Label)

+ 1 - 1
apt-pkg/deb/debmetaindex.h

@@ -36,7 +36,7 @@ class debReleaseIndex : public metaIndex {
    /** \brief dpointer placeholder (for later in case we need it) */
    void *d;
    std::map<std::string, std::vector<debSectionEntry const*> > ArchEntries;
-   enum { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
+   enum APT_HIDDEN { ALWAYS_TRUSTED, NEVER_TRUSTED, CHECK_TRUST } Trusted;
 
    public:
 

+ 1 - 1
apt-pkg/deb/debsystem.h

@@ -29,7 +29,7 @@ class debSystem : public pkgSystem
 {
    // private d-pointer
    debSystemPrivate *d;
-   bool CheckUpdates();
+   APT_HIDDEN bool CheckUpdates();
 
    public:
 

+ 1 - 1
apt-pkg/deb/dpkgpm.h

@@ -52,7 +52,7 @@ class pkgDPkgPM : public pkgPackageManager
       needs to declare a Replaces on the disappeared package.
       \param pkgname Name of the package that disappeared
    */
-   void handleDisappearAction(std::string const &pkgname);
+   APT_HIDDEN void handleDisappearAction(std::string const &pkgname);
 
    protected:
    int pkgFailures;

+ 14 - 0
apt-pkg/depcache.cc

@@ -1961,3 +1961,17 @@ bool pkgDepCache::Sweep()						/*{{{*/
    return true;
 }
 									/*}}}*/
+// DepCache::MarkAndSweep						/*{{{*/
+bool pkgDepCache::MarkAndSweep(InRootSetFunc &rootFunc)
+{
+   return MarkRequired(rootFunc) && Sweep();
+}
+bool pkgDepCache::MarkAndSweep()
+{
+   std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
+   if(f.get() != NULL)
+      return MarkAndSweep(*f.get());
+   else
+      return false;
+}
+									/*}}}*/

+ 7 - 18
apt-pkg/depcache.h

@@ -91,7 +91,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *  \param follow_suggests If \b true, suggestions of the package
     *  will be recursively marked.
     */
-   void MarkPackage(const pkgCache::PkgIterator &pkg,
+   APT_HIDDEN void MarkPackage(const pkgCache::PkgIterator &pkg,
 		    const pkgCache::VerIterator &ver,
 		    bool const &follow_recommends,
 		    bool const &follow_suggests);
@@ -109,7 +109,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *
     *  \return \b false if an error occurred.
     */
-   bool MarkRequired(InRootSetFunc &rootFunc);
+   APT_HIDDEN bool MarkRequired(InRootSetFunc &rootFunc);
 
    /** \brief Set the StateCache::Garbage flag on all packages that
     *  should be removed.
@@ -120,7 +120,7 @@ class pkgDepCache : protected pkgCache::Namespace
     *
     *  \return \b false if an error occurred.
     */
-   bool Sweep();
+   APT_HIDDEN bool Sweep();
 
    public:
    
@@ -169,7 +169,7 @@ class pkgDepCache : protected pkgCache::Namespace
        bool released;
 
        /** Action groups are noncopyable. */
-       ActionGroup(const ActionGroup &other);
+       APT_HIDDEN ActionGroup(const ActionGroup &other);
    public:
        /** \brief Create a new ActionGroup.
 	*
@@ -396,19 +396,8 @@ class pkgDepCache : protected pkgCache::Namespace
     *  \param rootFunc A predicate that returns \b true for packages
     *  that should be added to the root set.
     */
-   bool MarkAndSweep(InRootSetFunc &rootFunc)
-   {
-     return MarkRequired(rootFunc) && Sweep();
-   }
-
-   bool MarkAndSweep()
-   {
-     std::auto_ptr<InRootSetFunc> f(GetRootSetFunc());
-     if(f.get() != NULL)
-       return MarkAndSweep(*f.get());
-     else
-       return false;
-   }
+   bool MarkAndSweep(InRootSetFunc &rootFunc);
+   bool MarkAndSweep();
 
    /** \name State Manipulators
     */
@@ -514,7 +503,7 @@ class pkgDepCache : protected pkgCache::Namespace
 	 bool const rPurge, unsigned long const Depth, bool const FromUser);
 
    private:
-   bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
+   APT_HIDDEN bool IsModeChangeOk(ModeList const mode, PkgIterator const &Pkg,
 			unsigned long const Depth, bool const FromUser);
 };
 

+ 2 - 2
apt-pkg/indexcopy.h

@@ -93,8 +93,8 @@ class SigVerify								/*{{{*/
    /** \brief dpointer placeholder (for later in case we need it) */
    void *d;
 
-   bool Verify(std::string prefix,std::string file, indexRecords *records);
-   bool CopyMetaIndex(std::string CDROM, std::string CDName, 
+   APT_HIDDEN bool Verify(std::string prefix,std::string file, indexRecords *records);
+   APT_HIDDEN bool CopyMetaIndex(std::string CDROM, std::string CDName,
 		      std::string prefix, std::string file);
 
  public:

+ 1 - 1
apt-pkg/indexrecords.h

@@ -21,7 +21,7 @@
 
 class indexRecords
 {
-   bool parseSumData(const char *&Start, const char *End, std::string &Name,
+   APT_HIDDEN bool parseSumData(const char *&Start, const char *End, std::string &Name,
 		     std::string &Hash, unsigned long long &Size);
    public:
    struct checkSum;

+ 2 - 2
apt-pkg/install-progress.cc

@@ -21,8 +21,8 @@
 namespace APT {
 namespace Progress {
 
-PackageManager::PackageManager() : d(NULL), percentage(0.0), last_reported_progress(-1) {};
-PackageManager::~PackageManager() {};
+PackageManager::PackageManager() : d(NULL), percentage(0.0), last_reported_progress(-1) {}
+PackageManager::~PackageManager() {}
 
 /* Return a APT::Progress::PackageManager based on the global
  * apt configuration (i.e. APT::Status-Fd and APT::Status-deb822-Fd)

+ 1 - 1
apt-pkg/install-progress.h

@@ -119,7 +119,7 @@ namespace Progress {
  class PackageManagerFancy : public PackageManager
  {
  private:
-    static void staticSIGWINCH(int);
+    APT_HIDDEN static void staticSIGWINCH(int);
     static std::vector<PackageManagerFancy*> instances;
     APT_HIDDEN bool DrawStatusLine();
 

+ 1 - 1
apt-pkg/pkgcache.h

@@ -228,7 +228,7 @@ class pkgCache								/*{{{*/
 
 private:
    bool MultiArchEnabled;
-   PkgIterator SingleArchFindPkg(const std::string &Name);
+   APT_HIDDEN PkgIterator SingleArchFindPkg(const std::string &Name);
 };
 									/*}}}*/
 // Header structure							/*{{{*/

+ 3 - 3
apt-pkg/pkgcachegen.cc

@@ -836,7 +836,7 @@ map_pointer_t pkgCacheGenerator::NewVersion(pkgCache::VerIterator &Ver,
       }
    }
    // haven't found the version string, so create
-   map_stringitem_t const idxVerStr = StoreString(VERSION, VerStr);
+   map_stringitem_t const idxVerStr = StoreString(VERSIONNUMBER, VerStr);
    if (unlikely(idxVerStr == 0))
       return 0;
    Ver->VerStr = idxVerStr;
@@ -933,7 +933,7 @@ bool pkgCacheGenerator::NewDepends(pkgCache::PkgIterator &Pkg,
       if (index == 0)
       {
 	 void const * const oldMap = Map.Data();
-	 index = StoreString(VERSION, Version);
+	 index = StoreString(VERSIONNUMBER, Version);
 	 if (unlikely(index == 0))
 	    return false;
 	 if (OldDepLast != 0 && oldMap != Map.Data())
@@ -1129,7 +1129,7 @@ map_stringitem_t pkgCacheGenerator::StoreString(enum StringType const type, cons
    switch(type) {
       case MIXED: strings = &strMixed; break;
       case PKGNAME: strings = &strPkgNames; break;
-      case VERSION: strings = &strVersions; break;
+      case VERSIONNUMBER: strings = &strVersions; break;
       case SECTION: strings = &strSections; break;
       default: _error->Fatal("Unknown enum type used for string storage of '%s'", key.c_str()); return 0;
    }

+ 2 - 2
apt-pkg/pkgcachegen.h

@@ -95,8 +95,8 @@ class pkgCacheGenerator							/*{{{*/
 
    public:
 
-   enum StringType { MIXED, PKGNAME, VERSION, SECTION };
-   map_stringitem_t StoreString(enum StringType const type, const char * S, unsigned int const Size);
+   enum StringType { MIXED, PKGNAME, VERSIONNUMBER, SECTION };
+   map_stringitem_t StoreString(StringType const type, const char * S, unsigned int const Size);
    inline map_stringitem_t StoreString(enum StringType const type, const std::string &S) {return StoreString(type, S.c_str(),S.length());};
 
    void DropProgress() {Progress = 0;};

+ 2 - 1
apt-pkg/update.h

@@ -11,7 +11,8 @@
 #define PKGLIB_UPDATE_H
 
 class pkgAcquireStatus;
-
+class pkgSourceList;
+class pkgAcquire;
 
 bool ListUpdate(pkgAcquireStatus &progress, pkgSourceList &List, int PulseInterval=0);
 bool AcquireUpdate(pkgAcquire &Fetcher, int const PulseInterval = 0,

+ 1 - 1
cmdline/apt-get.cc

@@ -1578,7 +1578,7 @@ static bool DoChangelog(CommandLine &CmdL)
    {
       string changelogfile;
       if (downOnly == false)
-	 changelogfile.append(tmpname).append("changelog");
+	 changelogfile.append(tmpname).append("/changelog");
       else
 	 changelogfile.append(Ver.ParentPkg().Name()).append(".changelog");
       if (DownloadChangelog(Cache, Fetcher, Ver, changelogfile) && downOnly == false)

+ 5 - 1
debian/apt.postinst

@@ -15,13 +15,17 @@ set -e
 
 case "$1" in
     configure)
-	if dpkg --compare-versions "$2" lt 1.0.7; then
+	if dpkg --compare-versions "$2" lt 1.1~exp4; then
 	    # apt-key before 0.9.10 could leave empty keyrings around
 	    find /etc/apt/trusted.gpg.d/ -name '*.gpg' | while read keyring; do
 		if ! test -s "$keyring"; then
 		    rm -f "$keyring"
 		fi
 	    done
+	    # apt-key before 0.9.8.2 could create 0600 trusted.gpg file
+	    if test -e /etc/apt/trusted.gpg ; then
+	        chmod -f 0644 /etc/apt/trusted.gpg || true
+	    fi
 	fi
 
 	if dpkg --compare-versions "$2" lt-nl 0.9.9.5; then

+ 2 - 2
debian/control

@@ -38,12 +38,12 @@ Description: commandline package manager
   * apt-config as an interface to the configuration settings
   * apt-key as an interface to manage authentication keys
 
-Package: libapt-pkg4.13
+Package: libapt-pkg4.14
 Architecture: any
 Multi-Arch: same
 Pre-Depends: ${misc:Pre-Depends}
 Depends: ${shlibs:Depends}, ${misc:Depends}
-Breaks: apt (<< 1.0.2~), libapt-inst1.5 (<< 0.9.9~)
+Breaks: apt (<< 1.1~exp4), libapt-inst1.5 (<< 0.9.9~)
 Section: libs
 Description: package management runtime library
  This library provides the common functionality for searching and

debian/libapt-pkg4.13.install.in → debian/libapt-pkg4.14.install.in


File diff suppressed because it is too large
+ 303 - 111
debian/libapt-pkg4.13.symbols


+ 6 - 3
debian/rules

@@ -21,9 +21,12 @@ endif
 -include build/environment.mak
 
 ifneq (,$(shell which dpkg-buildflags))
-  export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
-  export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
-  export CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
+  # make does not export to $(shell) so we need to workaround 
+  # (http://savannah.gnu.org/bugs/?10593)
+  dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags
+  export CXXFLAGS = $(shell $(dpkg_buildflags) --get CXXFLAGS)
+  export LDFLAGS = $(shell $(dpkg_buildflags) --get LDFLAGS)
+  export CPPFLAGS = $(shell $(dpkg_buildflags) --get CPPFLAGS)
 else
   ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
     export CXXFLAGS = -O0 -g -Wall

+ 16 - 16
po/cs.po

@@ -8,7 +8,7 @@ msgstr ""
 "Project-Id-Version: apt\n"
 "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
 "POT-Creation-Date: 2014-09-09 20:35+0200\n"
-"PO-Revision-Date: 2014-08-15 13:30+0200\n"
+"PO-Revision-Date: 2014-10-05 06:09+0200\n"
 "Last-Translator: Miroslav Kure <kurem@debian.cz>\n"
 "Language-Team: Czech <debian-l10n-czech@lists.debian.org>\n"
 "Language: cs\n"
@@ -122,7 +122,7 @@ msgstr "Soubory balíku:"
 
 #: cmdline/apt-cache.cc:1553 cmdline/apt-cache.cc:1644
 msgid "Cache is out of sync, can't x-ref a package file"
-msgstr "Cache není synchronizovaná, nemohu se odkázat na soubor balíku"
+msgstr "Cache není synchronizovaná, nelze se odkázat na soubor balíku"
 
 #. Show any packages have explicit pins
 #: cmdline/apt-cache.cc:1567
@@ -622,7 +622,7 @@ msgstr ""
 
 #: cmdline/apt-helper.cc:36
 msgid "Need one URL as argument"
-msgstr ""
+msgstr "Jako argument vyžaduje jedno URL"
 
 #: cmdline/apt-helper.cc:49
 msgid "Must specify at least one pair url/filename"
@@ -633,7 +633,6 @@ msgid "Download Failed"
 msgstr "Stažení selhalo"
 
 #: cmdline/apt-helper.cc:80
-#, fuzzy
 msgid ""
 "Usage: apt-helper [options] command\n"
 "       apt-helper [options] download-file uri target-path\n"
@@ -653,6 +652,7 @@ msgstr ""
 "\n"
 "Příkazy:\n"
 "   download-file - stáhne zadané uri do cílové cesty\n"
+"   auto-detect-proxy - detekuje proxy pomocí apt.conf\n"
 "\n"
 "                       Tento APT pomocník má schopnosti svatého čehokoliv.\n"
 
@@ -1055,15 +1055,15 @@ msgstr "Nelze se připojit k %s:%s:"
 #: methods/gpgv.cc:168
 msgid ""
 "Internal error: Good signature, but could not determine key fingerprint?!"
-msgstr "Vnitřní chyba: Dobrý podpis, ale nemohu zjistit otisk klíče?!"
+msgstr "Vnitřní chyba: Dobrý podpis, ale nelze zjistit otisk klíče?!"
 
 #: methods/gpgv.cc:172
 msgid "At least one invalid signature was encountered."
 msgstr "Byl zaznamenán nejméně jeden neplatný podpis. "
 
 #: methods/gpgv.cc:174
-msgid "Could not execute 'apt-key' to verify signature (is gnupg installed?)"
-msgstr "Nelze spustit „apt-key“ pro ověření podpisu (je gnupg nainstalováno?)"
+msgid "Could not execute 'gpgv' to verify signature (is gpgv installed?)"
+msgstr "Nelze spustit „gpgv“ pro ověření podpisu (je gpgv nainstalováno?)"
 
 #. TRANSLATORS: %s is a single techy word like 'NODATA'
 #: methods/gpgv.cc:180
@@ -1076,8 +1076,8 @@ msgstr ""
 "ověření?)"
 
 #: methods/gpgv.cc:184
-msgid "Unknown error executing apt-key"
-msgstr "Neznámá chyba při spouštění apt-key"
+msgid "Unknown error executing gpgv"
+msgstr "Neznámá chyba při spouštění gpgv"
 
 #: methods/gpgv.cc:217 methods/gpgv.cc:224
 msgid "The following signatures were invalid:\n"
@@ -1383,7 +1383,7 @@ msgstr "Poznámka: Toto má svůj důvod a děje se automaticky v dpkg."
 
 #: apt-private/private-install.cc:391
 msgid "We are not supposed to delete stuff, can't start AutoRemover"
-msgstr "Neměli bychom mazat věci, nemůžu spustit AutoRemover"
+msgstr "Neměli bychom mazat věci, nelze spustit AutoRemover"
 
 #: apt-private/private-install.cc:499
 msgid ""
@@ -1757,8 +1757,8 @@ msgid "All packages are up to date."
 msgstr "Všechny balíky jsou aktuální."
 
 #: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade"
-msgstr "Propočítává se aktualizace"
+msgid "Calculating upgrade... "
+msgstr "Propočítává se aktualizace"
 
 #: apt-private/private-upgrade.cc:28
 msgid "Done"
@@ -2406,7 +2406,7 @@ msgstr "Toto není platný DEB archiv, chybí část „%s“"
 #: apt-inst/deb/debfile.cc:132
 #, c-format
 msgid "Internal error, could not locate member %s"
-msgstr "Vnitřní chyba, nemohu najít část %s"
+msgstr "Vnitřní chyba, nelze najít část %s"
 
 #: apt-inst/deb/debfile.cc:227
 msgid "Unparsable control file"
@@ -2735,7 +2735,7 @@ msgstr "Generování závislostí"
 
 #: apt-pkg/depcache.cc:188 apt-pkg/depcache.cc:221 apt-pkg/depcache.cc:225
 msgid "Reading state information"
-msgstr "Čtu stavové informace"
+msgstr "Načítají se stavové informace"
 
 #: apt-pkg/depcache.cc:250
 #, c-format
@@ -2994,7 +2994,7 @@ msgstr "Nešlo vyhodnotit seznam zdrojových balíků %s"
 #: apt-pkg/pkgcachegen.cc:1299 apt-pkg/pkgcachegen.cc:1403
 #: apt-pkg/pkgcachegen.cc:1409 apt-pkg/pkgcachegen.cc:1566
 msgid "Reading package lists"
-msgstr "Čtu seznamy balíků"
+msgstr "Načítají se seznamy balíků"
 
 #: apt-pkg/pkgcachegen.cc:1316
 msgid "Collecting File Provides"
@@ -3080,7 +3080,7 @@ msgstr "Zkomolený řádek %lu v seznamu zdrojů %s (zpracování URI)"
 #: apt-pkg/sourcelist.cc:217
 #, c-format
 msgid "Malformed line %lu in source list %s (absolute dist)"
-msgstr "Zkomolený řádek %lu v seznamu zdrojů %s (Absolutní dist)"
+msgstr "Zkomolený řádek %lu v seznamu zdrojů %s (absolutní dist)"
 
 #: apt-pkg/sourcelist.cc:224
 #, c-format

+ 90 - 93
po/tr.po

@@ -9,7 +9,7 @@ msgstr ""
 "Project-Id-Version: apt\n"
 "Report-Msgid-Bugs-To: APT Development Team <deity@lists.debian.org>\n"
 "POT-Creation-Date: 2014-09-09 20:35+0200\n"
-"PO-Revision-Date: 2014-09-11 02:47+0200\n"
+"PO-Revision-Date: 2014-09-29 22:08+0200\n"
 "Last-Translator: Mert Dirik <mertdirik@gmail.com>\n"
 "Language-Team: Debian l10n Turkish <debian-l10n-turkish@lists.debian.org>\n"
 "Language: tr\n"
@@ -83,7 +83,7 @@ msgstr "Toplam birikmiş dizgiler: "
 
 #: cmdline/apt-cache.cc:362
 msgid "Total dependency version space: "
-msgstr "Toplam bağlımlık sürümü alanı: "
+msgstr "Toplam bağımlılık sürümü alanı: "
 
 #: cmdline/apt-cache.cc:367
 msgid "Total slack space: "
@@ -127,7 +127,7 @@ msgstr "Paket dosyaları:"
 
 #: cmdline/apt-cache.cc:1553 cmdline/apt-cache.cc:1644
 msgid "Cache is out of sync, can't x-ref a package file"
-msgstr "Önbellek eşzamanlı değil, paket dosyası 'x-ref' yapılamıyor."
+msgstr "Önbellek eşzamanlı değil, paket dosyası 'x-ref' yapılamıyor"
 
 #. Show any packages have explicit pins
 #: cmdline/apt-cache.cc:1567
@@ -205,8 +205,8 @@ msgid ""
 "See the apt-cache(8) and apt.conf(5) manual pages for more information.\n"
 msgstr ""
 "Kullanım: apt-cache [seçenekler] komut\n"
-"       apt-cache [seçenekler] showpkg paket1 [paket2 ...]\n"
-"       apt-cache [seçenekler] showsrc paket1 [paket2 ...]\n"
+"          apt-cache [seçenekler] showpkg paket1 [paket2 ...]\n"
+"          apt-cache [seçenekler] showsrc paket1 [paket2 ...]\n"
 "\n"
 "apt-cache APT'nin ikili paket önbelleğindeki dosyaları\n"
 "sorgulamakta kullanılan alt seviye bir araçtır.\n"
@@ -233,7 +233,7 @@ msgstr ""
 "  -p=? Paket önbelleği.\n"
 "  -s=? Kaynak önbelleği.\n"
 "  -q   İlerleme göstergesini kapat.\n"
-"  -i   unmet komutunda yalnızca önemli bağımlılıkları görüntüle.\n"
+"  -i   unmet komutunda sadece önemli bağımlılıkları görüntüle.\n"
 "  -c=? Belirtilen yapılandırma dosyasını kullan\n"
 "  -o=? Herhangi bir yapılandırma seçeneğini ayarla, örneğin -o dir::cache=/"
 "tmp\n"
@@ -242,7 +242,7 @@ msgstr ""
 
 #: cmdline/apt-cdrom.cc:76
 msgid "Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1'"
-msgstr "Lütfen bu CD/DVD'ye bir isim verin, örneğin 'Debian 5.0.3 Disk 1'"
+msgstr "Lütfen bu CD/DVD'ye bir ad verin, örneğin 'Debian 5.0.3 Disk 1'"
 
 #: cmdline/apt-cdrom.cc:91
 msgid "Please insert a Disc in the drive and press enter"
@@ -272,7 +272,7 @@ msgstr "Kalan CD'leriniz için bu işlemi yineleyin."
 
 #: cmdline/apt-config.cc:48
 msgid "Arguments not in pairs"
-msgstr "Değişkenler (argüman) çiftler halinde değil"
+msgstr "Argümanlar çiftler halinde değil"
 
 #: cmdline/apt-config.cc:89
 msgid ""
@@ -337,7 +337,7 @@ msgstr "%s paketi bulunamadı"
 #: apt-private/private-install.cc:865
 #, c-format
 msgid "%s set to manually installed.\n"
-msgstr "%s elle kurulmuş olarak ayarlı.\n"
+msgstr "%s elle kurulmuş olarak ayarlandı.\n"
 
 #: cmdline/apt-get.cc:461 cmdline/apt-mark.cc:83
 #, c-format
@@ -437,7 +437,7 @@ msgstr "İndirme işlemi tamamlandı ve sadece indirme kipinde"
 #: cmdline/apt-get.cc:950
 #, c-format
 msgid "Skipping unpack of already unpacked source in %s\n"
-msgstr "%s için zaten açılmış bazı paketlerin açılması atlanıyor.\n"
+msgstr "%s için zaten açılmış bazı paketlerin açılması atlanıyor\n"
 
 #: cmdline/apt-get.cc:963
 #, c-format
@@ -460,7 +460,7 @@ msgstr "Alt süreç başarısız"
 
 #: cmdline/apt-get.cc:1030
 msgid "Must specify at least one package to check builddeps for"
-msgstr "İnşa bağımlılıklarının denetleneceği en az bir paket belirtilmedilir"
+msgstr "İnşa bağımlılıklarının denetleneceği en az bir paket belirtilmelidir"
 
 #: cmdline/apt-get.cc:1055
 #, c-format
@@ -469,7 +469,7 @@ msgid ""
 "Architectures for setup"
 msgstr ""
 "%s mimarisine uygun mimari bilgileri mevcut değil. Kurulumu için apt.conf(5) "
-"rehber sayfasındaki APT::Architectures kısmına göz atın."
+"rehber sayfasındaki APT::Architectures kısmına göz atın"
 
 #: cmdline/apt-get.cc:1079 cmdline/apt-get.cc:1082
 #, c-format
@@ -488,7 +488,7 @@ msgid ""
 "packages"
 msgstr ""
 "'%4$s' paketlerinde %3$s paketine izin verilmediği için %2$s kaynağının %1$s "
-"bağımlılığı karşılanamıyor."
+"bağımlılığı karşılanamıyor"
 
 #: cmdline/apt-get.cc:1290
 #, c-format
@@ -496,12 +496,12 @@ msgid ""
 "%s dependency for %s cannot be satisfied because the package %s cannot be "
 "found"
 msgstr ""
-"%2$s için %1$s bağımlılığı, %3$s paketi bulunamadığı için karşılanamadı."
+"%2$s için %1$s bağımlılığı, %3$s paketi bulunamadığı için karşılanamadı"
 
 #: cmdline/apt-get.cc:1313
 #, c-format
 msgid "Failed to satisfy %s dependency for %s: Installed package %s is too new"
-msgstr "%2$s için %1$s bağımlılığı karşılanamadı: Kurulu %3$s paketi çok yeni."
+msgstr "%2$s için %1$s bağımlılığı karşılanamadı: Kurulu %3$s paketi çok yeni"
 
 #: cmdline/apt-get.cc:1352
 #, c-format
@@ -589,17 +589,17 @@ msgid ""
 "                       This APT has Super Cow Powers.\n"
 msgstr ""
 "Kullanım: apt-get [seçenekler] komut\n"
-"       apt-get [seçenekler] install|remove paket1 [paket2 ...]\n"
-"       apt-get [seçenekler] kaynak paket1 [paket2 ...]\n"
+"          apt-get [seçenekler] install|remove paket1 [paket2 ...]\n"
+"          apt-get [seçenekler] kaynak paket1 [paket2 ...]\n"
 "\n"
-"apt-get, paket indirmek ve kurmakta kullanılan basit bir komut satırı\n"
+"apt-get, paket indirme ve kurmada kullanılan basit bir komut satırı\n"
 "arayüzüdür. En sık kullanılan komutlar güncelleme (update) ve kurma\n"
 "(install) komutlarıdır.\n"
 "\n"
 "Komutlar:\n"
 "   update - Paket listelerini yenile\n"
 "   upgrade - Yükseltme işlemini gerçekleştir\n"
-"   install - Yeni paket kur (paket adı libc6.deb değil libc6 şeklinde "
+"   install - Yeni paket kur (paket libc6.deb değil libc6 şeklinde "
 "olmalıdır)\n"
 "   remove - Paket(leri) kaldır\n"
 "   autoremove - Kullanılmayan tüm paketleri otomatik olarak kaldır\n"
@@ -619,7 +619,7 @@ msgstr ""
 "  -h  Bu yardım metni.\n"
 "  -q  Günlük tutmaya uygun çıktı - İlerleme göstergesi yok\n"
 "  -qq Hata olmadığı müddetçe çıktıya bir şey yazma\n"
-"  -d  Yalnızca indir - Paketleri açmaz ve kurmaz\n"
+"  -d  Sadece indir - Paketleri açmaz ve kurmaz\n"
 "  -s  Bir şey yapma. Simülasyon kipinde çalış\n"
 "  -y  Tüm sorulara Evet yanıtını ver ve soru sorma\n"
 "  -f  Eksik bağımlılıklara sahip bir sistemi onarmaya çalış\n"
@@ -639,7 +639,7 @@ msgstr "Argüman olarak bir adet URL'ye ihtiyaç vardır"
 
 #: cmdline/apt-helper.cc:49
 msgid "Must specify at least one pair url/filename"
-msgstr "En az bir adet url/dosyaadı çifti belirtilmelidir"
+msgstr "En az bir adet url/dosya-adı çifti belirtilmelidir"
 
 #: cmdline/apt-helper.cc:67
 msgid "Download Failed"
@@ -661,7 +661,7 @@ msgstr ""
 "Usage: apt-helper [seçenekler] komut\n"
 "       apt-helper [seçenekler] download-file uri hedef-konum\n"
 "\n"
-"apt-helper apt'nin dahili yardımcı aracıdır\n"
+"apt-helper apt'nin dâhilî yardımcı aracıdır\n"
 "\n"
 "Komutlar:\n"
 "   download-file - verilen adresi hedef yola kaydet\n"
@@ -759,7 +759,7 @@ msgstr ""
 "  -h  Bu yardım metni.\n"
 "  -q  Günlük tutmaya uygun çıktı - İlerleme göstergesi yok\n"
 "  -qq Hata olmadığı müddetçe çıktıya bir şey yazma\n"
-"  -s  Bir şey yapma. Yalnızca ne yapılacağını söyler.\n"
+"  -s  Bir şey yapma. Sadece ne yapılacağını söyler.\n"
 "  -f  read/write auto/manual marking in the given file\n"
 "  -c=? Belirtilen yapılandırma dosyası kullan\n"
 "  -o=? Yapılandırma seçeneği ayarla, örneğin -o dir::cache=/tmp\n"
@@ -817,7 +817,7 @@ msgid ""
 "cannot be used to add new CD-ROMs"
 msgstr ""
 "Lütfen bu CD-ROM'un APT tarafından tanınması için apt-cdrom aracını "
-"kullanın. apt-get update yeni CD-ROM'lar eklemek için kullanılamaz."
+"kullanın. apt-get update yeni CD-ROM'lar eklemek için kullanılamaz"
 
 #: methods/cdrom.cc:222
 msgid "Wrong CD-ROM"
@@ -826,7 +826,7 @@ msgstr "Yanlış CD-ROM"
 #: methods/cdrom.cc:249
 #, c-format
 msgid "Unable to unmount the CD-ROM in %s, it may still be in use."
-msgstr "%s konumundaki CD-ROM çıkarılamıyor, hala kullanımda olabilir."
+msgstr "%s konumundaki CD-ROM çıkarılamıyor, hâlâ kullanımda olabilir."
 
 #: methods/cdrom.cc:254
 msgid "Disk not found."
@@ -1065,7 +1065,7 @@ msgstr "'%s:%s' (%i - %s) adresi çözümlenirken bir şeyler kötü gitti"
 #: methods/connect.cc:258
 #, c-format
 msgid "Unable to connect to %s:%s:"
-msgstr "Bağlanılamıyor %s:%s:"
+msgstr "Bağlanılamadı %s:%s:"
 
 #: methods/gpgv.cc:168
 msgid ""
@@ -1211,7 +1211,7 @@ msgid ""
 msgstr ""
 "Ortam değişimi: Lütfen '%2$s' sürücüsüne\n"
 " '%1$s'\n"
-"olarak etiketlenmiş diski takın ve enter tuşuna basın.\n"
+"olarak etiketlenmiş diski takın ve enter tuşuna basın\n"
 
 #: apt-private/private-cachefile.cc:93
 msgid "Correcting dependencies..."
@@ -1290,7 +1290,7 @@ msgstr "İç hata, Sıralama tamamlanamadı"
 msgid "How odd... The sizes didn't match, email apt@packages.debian.org"
 msgstr ""
 "Ne kadar ilginç... Boyutlar eşleşmedi, apt@packages.debian.org adresine "
-"eposta atın."
+"eposta atın"
 
 #. TRANSLATOR: The required space between number and unit is already included
 #. in the replacement strings, so %sB will be correctly translate in e.g. 1,5 MB
@@ -1327,8 +1327,7 @@ msgstr "%s içinde yeterli boş alanınız yok."
 
 #: apt-private/private-install.cc:216 apt-private/private-install.cc:238
 msgid "Trivial Only specified but this is not a trivial operation."
-msgstr ""
-"Yalnızca Önemsiz seçeneği ayarlandı, fakat bu önemsiz bir işlem bir değil."
+msgstr "Sadece Önemsiz seçeneği ayarlandı, ama bu önemsiz bir işlem değil."
 
 #. TRANSLATOR: This string needs to be typed by the user as a confirmation, so be
 #. careful with hard to type or special characters (like non-breaking spaces)
@@ -1510,8 +1509,7 @@ msgstr ""
 #, c-format
 msgid "Reinstallation of %s is not possible, it cannot be downloaded.\n"
 msgstr ""
-"%s paketinin yeniden kurulumu mümkün değil, çünkü paket internetten "
-"indirilemedi.\n"
+"%s paketinin yeniden kurulumu mümkün değil, çünkü paket indirilemedi.\n"
 
 #: apt-private/private-install.cc:846
 #, c-format
@@ -1539,7 +1537,7 @@ msgstr ""
 #: apt-private/private-install.cc:947
 #, c-format
 msgid "Package '%s' is not installed, so not removed\n"
-msgstr "'%s' kurulu değildi, dolayısıyla kaldırılmadı.\n"
+msgstr "'%s' kurulu değildi, dolayısıyla kaldırılmadı\n"
 
 #: apt-private/private-list.cc:129
 msgid "Listing"
@@ -1550,11 +1548,10 @@ msgstr "Listeleme"
 msgid "There is %i additional version. Please use the '-a' switch to see it"
 msgid_plural ""
 "There are %i additional versions. Please use the '-a' switch to see them."
-msgstr[0] ""
-"Fazladan %i sürüm daha var. Görmek için '-a' anahtarını kullanabilirsiniz."
+msgstr[0] "Fazladan %i sürüm daha var. Görmek için '-a' anahtarını kullanın."
 msgstr[1] ""
 "Fazladan %i sürüm daha var. Bu sürümleri görmek için '-a' anahtarını "
-"kullanabilirsiniz."
+"kullanın."
 
 #: apt-private/private-main.cc:32
 msgid ""
@@ -1563,10 +1560,10 @@ msgid ""
 "      Keep also in mind that locking is deactivated,\n"
 "      so don't depend on the relevance to the real current situation!"
 msgstr ""
-"NOT:  Bu yalnızca bir benzetimdir!\n"
+"NOT:  Bu sadece bir benzetimdir!\n"
 "      apt-get'i gerçekten çalıştırmak için root haklarına ihtiyaç vardır.\n"
 "      Unutmayın ki benzetim kipinde kilitleme yapılmaz, bu nedenle\n"
-"      bu benzetimin gerçekteki durumla birebir aynı olacağına güvenmeyin."
+"      bu benzetimin gerçekteki durumla birebir aynı olacağına güvenmeyin!"
 
 #: apt-private/private-output.cc:103 apt-private/private-show.cc:84
 #: apt-private/private-show.cc:89
@@ -1739,10 +1736,10 @@ msgstr "Tam Metin Arama"
 msgid "There is %i additional record. Please use the '-a' switch to see it"
 msgid_plural ""
 "There are %i additional records. Please use the '-a' switch to see them."
-msgstr[0] ""
-"Fazladan %i kayıt daha var. Görmek için '-a' anahtarını kullanabilirsiniz."
+msgstr[0] "Fazladan %i kayıt daha var. Görmek için '-a' anahtarını kullanın."
 msgstr[1] ""
-"Fazladan %i kayıt daha var. Görmek için '-a' anahtarını kullanabilirsiniz."
+"Fazladan %i kayıt daha var. Bu kayıtları görmek için '-a' anahtarını "
+"kullanın. kullanabilirsiniz."
 
 #: apt-private/private-show.cc:163
 msgid "not a real package (virtual)"
@@ -1751,7 +1748,7 @@ msgstr "gerçek bir paket değil (sanal)"
 #: apt-private/private-sources.cc:58
 #, c-format
 msgid "Failed to parse %s. Edit again? "
-msgstr "%s ayrıştırılamadı. Tekrar düzenlemek ister misiniz?"
+msgstr "%s ayrıştırılamadı. Tekrar düzenlemek ister misiniz? "
 
 #: apt-private/private-sources.cc:70
 #, c-format
@@ -1760,7 +1757,7 @@ msgstr "'%s' dosyası değişti, lütfen 'apt-get update' komutunu çalıştır
 
 #: apt-private/private-update.cc:31
 msgid "The update command takes no arguments"
-msgstr "'update' komutu bağımsız değişken almamaktadır"
+msgstr "'update' komutu argüman almaz"
 
 #: apt-private/private-update.cc:90
 #, c-format
@@ -1779,8 +1776,8 @@ msgid "All packages are up to date."
 msgstr "Tüm paketler güncel."
 
 #: apt-private/private-upgrade.cc:25
-msgid "Calculating upgrade"
-msgstr "Yükseltme hesaplanıyor"
+msgid "Calculating upgrade... "
+msgstr "Yükseltme hesaplanıyor... "
 
 #: apt-private/private-upgrade.cc:28
 msgid "Done"
@@ -1862,7 +1859,7 @@ msgstr "Bu durum, çift hata iletilerine ya da eksik bağımlılıkların neden"
 #: dselect/install:104
 msgid "or errors caused by missing dependencies. This is OK, only the errors"
 msgstr ""
-"olduğu hatalara yol açabilir. Bu durum bir sorun teşkil etmez, yalnızca bu "
+"olduğu hatalara yol açabilir. Bu durum bir sorun teşkil etmez, sadece bu "
 "iletinin"
 
 #: dselect/install:105
@@ -1931,7 +1928,7 @@ msgstr "Kaynak uzantı listesi çok uzun"
 
 #: ftparchive/apt-ftparchive.cc:401
 msgid "Error writing header to contents file"
-msgstr "İçindekiler dosyasına üstbilgi yazmada hata"
+msgstr "İçindekiler dosyasına başlık yazmada hata"
 
 #: ftparchive/apt-ftparchive.cc:431
 #, c-format
@@ -1980,12 +1977,12 @@ msgid ""
 "  -o=?  Set an arbitrary configuration option"
 msgstr ""
 "Kullanım: apt-ftparchive [seçenekler] komut\n"
-"Komutlar: packages ikilikonumu [geçersizkılmadosyası [konumöneki]]\n"
-"          sources kaynakkonumu [geçersizkılmadosyası [konumöneki]]\n"
-"          contents konum\n"
-"          release konum\n"
-"          generate yapılandırma [gruplar]\n"
-"          clean yapılandırma\n"
+"Komutlar:   packages ikilikonumu [geçersizkılmadosyası [konumöneki]]\n"
+"            sources kaynakkonumu [geçersizkılmadosyası [konumöneki]]\n"
+"            contents konum\n"
+"            release konum\n"
+"            generate yapılandırma [gruplar]\n"
+"            clean yapılandırma\n"
 "\n"
 "apt-ftparchive Debian arşivleri için indeks dosyaları üretir. \n"
 "dpkg-scanpackages ve dpkg-scansources için tamamen otomatikten\n"
@@ -2016,7 +2013,7 @@ msgstr ""
 "  -s=?  Kaynak geçersiz kılma dosyası\n"
 "  -q    Sessiz\n"
 "  -d=?  Seçimlik önbellek veritabanını seç\n"
-"  --no-delink Bağlantılanmamış hata ayıklama kipini etkinleştir\n"
+"  --no-delink Bağ kurulmamış hata ayıklama kipini etkinleştir\n"
 "  --contents  İçerik dosyası üretimini denetle\n"
 "  -c=?  Belirtilen yapılandırma dosyası kullan\n"
 "  -o=?  Yapılandırma seçeneği ayarla"
@@ -2074,24 +2071,24 @@ msgstr "İmleç alınamıyor"
 #: ftparchive/writer.cc:91
 #, c-format
 msgid "W: Unable to read directory %s\n"
-msgstr "W: %s dizini okunamıyor\n"
+msgstr "U: %s dizini okunamıyor\n"
 
 #: ftparchive/writer.cc:96
 #, c-format
 msgid "W: Unable to stat %s\n"
-msgstr "W: %s durum bilgisi alınamıyor\n"
+msgstr "U: %s durum bilgisi alınamıyor\n"
 
 #: ftparchive/writer.cc:152
 msgid "E: "
-msgstr "E: "
+msgstr "H: "
 
 #: ftparchive/writer.cc:154
 msgid "W: "
-msgstr "W: "
+msgstr "U: "
 
 #: ftparchive/writer.cc:161
 msgid "E: Errors apply to file "
-msgstr "E: Hatalar şu dosya için geçerli: "
+msgstr "H: Hatalar şu dosya için geçerli: "
 
 #: ftparchive/writer.cc:179 ftparchive/writer.cc:211
 #, c-format
@@ -2115,12 +2112,12 @@ msgstr " DeLink %s [%s]\n"
 #: ftparchive/writer.cc:286
 #, c-format
 msgid "Failed to readlink %s"
-msgstr "%s bağlantı okuması başarılamadı"
+msgstr "%s readlink çağrısı başarısız oldu"
 
 #: ftparchive/writer.cc:290
 #, c-format
 msgid "Failed to unlink %s"
-msgstr "%s bağlantı koparma başarılamadı"
+msgstr "%s bağı koparılamadı"
 
 #: ftparchive/writer.cc:298
 #, c-format
@@ -2130,7 +2127,7 @@ msgstr "*** %s, %s konumuna bağlanamadı"
 #: ftparchive/writer.cc:308
 #, c-format
 msgid " DeLink limit of %sB hit.\n"
-msgstr " %sB'lik bağlantı koparma (DeLink) sınırına ulaşıldı.\n"
+msgstr " %sB'lik bağ koparma (DeLink) sınırına ulaşıldı.\n"
 
 #: ftparchive/writer.cc:417
 msgid "Archive had no package field"
@@ -2200,7 +2197,7 @@ msgstr "Bilinmeyen sıkıştırma algoritması '%s'"
 #: ftparchive/multicompress.cc:103
 #, c-format
 msgid "Compressed output %s needs a compression set"
-msgstr "Sıkıştırılmış %s çıktısı bir sıkıştırma kümesine ihtiyaç duymaktadır."
+msgstr "Sıkıştırılmış %s çıktısı bir sıkıştırma kümesine ihtiyaç duymaktadır"
 
 #: ftparchive/multicompress.cc:192
 msgid "Failed to create FILE*"
@@ -2252,7 +2249,7 @@ msgid ""
 msgstr ""
 "Kullanım: apt-internal-solver\n"
 "\n"
-"apt-internal-solver mevcut dahili çözücüyü (hata ayıklama\n"
+"apt-internal-solver mevcut dâhilî çözücüyü (hata ayıklama\n"
 "gibi sebeplerle) harici çözücü gibi kullanmaya yarayan bir\n"
 "arayüzdür.\n"
 "\n"
@@ -2355,11 +2352,11 @@ msgstr "%s durum bilgisi alınamadı"
 
 #: apt-inst/filelist.cc:380
 msgid "DropNode called on still linked node"
-msgstr "DropNode hala bağlı olan düğüm üzerinde çağrıldı"
+msgstr "DropNode hâlâ bağlı olan düğüm üzerinde çağrıldı"
 
 #: apt-inst/filelist.cc:412
 msgid "Failed to locate the hash element!"
-msgstr "Sağlama elementi bulunamadı"
+msgstr "Sağlama elementi bulunamadı!"
 
 #: apt-inst/filelist.cc:459
 msgid "Failed to allocate diversion"
@@ -2395,7 +2392,7 @@ msgstr "Arşiv üyesi başlığı okuma hatası"
 #: apt-inst/contrib/arfile.cc:96
 #, c-format
 msgid "Invalid archive member header %s"
-msgstr "Geçerşiz arşiv üyesi başlığı %s"
+msgstr "Geçersiz arşiv üyesi başlığı %s"
 
 #: apt-inst/contrib/arfile.cc:108
 msgid "Invalid archive member header"
@@ -2610,8 +2607,7 @@ msgstr "Paket listeleri ya da durum dosyası ayrıştırılamadı ya da açılam
 
 #: apt-pkg/cachefile.cc:98
 msgid "You may want to run apt-get update to correct these problems"
-msgstr ""
-"Bu sorunları gidermek için apt-get update komutunu çalıştırabilirsiniz."
+msgstr "Bu sorunları gidermek için apt-get update komutunu çalıştırabilirsiniz"
 
 #: apt-pkg/cachefile.cc:116
 msgid "The list of sources could not be read."
@@ -2743,7 +2739,7 @@ msgstr ""
 
 #: apt-pkg/cdrom.cc:819
 msgid "Copying package lists..."
-msgstr "Paket listeleri kopyalanıyor.."
+msgstr "Paket listeleri kopyalanıyor..."
 
 #: apt-pkg/cdrom.cc:863
 msgid "Writing new source list\n"
@@ -2777,7 +2773,7 @@ msgstr "Durum bilgisi okunuyor"
 #: apt-pkg/depcache.cc:250
 #, c-format
 msgid "Failed to open StateFile %s"
-msgstr "Durum dosyası (StateFile) %s açılamadı."
+msgstr "Durum dosyası (StateFile) %s açılamadı"
 
 #: apt-pkg/depcache.cc:256
 #, c-format
@@ -2827,7 +2823,7 @@ msgstr "%2$i eksik dosya ve %3$i eşleşmeyen dosyayla %1$i kayıt yazıldı\n"
 #: apt-pkg/indexcopy.cc:515
 #, c-format
 msgid "Can't find authentication record for: %s"
-msgstr "%s için kimlik doğrulama kaydı bulunamadı."
+msgstr "%s için kimlik doğrulama kaydı bulunamadı"
 
 #: apt-pkg/indexcopy.cc:521
 #, c-format
@@ -2905,7 +2901,7 @@ msgstr ""
 
 #: apt-pkg/pkgcache.cc:155
 msgid "Empty package cache"
-msgstr "Boş paket önbelleği"
+msgstr "Paket önbelleği boş"
 
 #: apt-pkg/pkgcache.cc:161
 msgid "The package cache file is corrupted"
@@ -2922,7 +2918,7 @@ msgstr "Paket önbellek dosyası bozulmuş, çok küçük"
 #: apt-pkg/pkgcache.cc:174
 #, c-format
 msgid "This APT does not support the versioning system '%s'"
-msgstr "Bu APT '%s' sürümleme sistemini desteklemiyor."
+msgstr "Bu APT '%s' sürümleme sistemini desteklemiyor"
 
 #: apt-pkg/pkgcache.cc:179
 msgid "The package cache was built for a different architecture"
@@ -3054,7 +3050,7 @@ msgid ""
 "available in the sources"
 msgstr ""
 "APT::Default-Release için '%s' değeri geçersizdir, çünkü kaynaklarda böyle "
-"bir sürüm yok."
+"bir sürüm yok"
 
 #: apt-pkg/policy.cc:422
 #, c-format
@@ -3159,7 +3155,7 @@ msgstr "'%s' türü bilinmiyor (girdi: %u, kaynak listesi: %s)"
 
 #: apt-pkg/srcrecords.cc:52
 msgid "You must put some 'source' URIs in your sources.list"
-msgstr "'sources.list' dosyası içine bazı 'source' adresleri koymalısınız."
+msgstr "'sources.list' dosyası içine bazı 'source' adresleri koymalısınız"
 
 #: apt-pkg/tagfile.cc:140
 #, c-format
@@ -3212,7 +3208,7 @@ msgstr "Komut satırı seçeneği %s mantıksal değer değil"
 #: apt-pkg/contrib/cmndline.cc:209 apt-pkg/contrib/cmndline.cc:230
 #, c-format
 msgid "Option %s requires an argument."
-msgstr "%s seçeneği bir bağımsız değişkene gerek duyar."
+msgstr "%s seçeneği bir argüman kullanımını gerektirir."
 
 #: apt-pkg/contrib/cmndline.cc:243 apt-pkg/contrib/cmndline.cc:249
 #, c-format
@@ -3224,7 +3220,8 @@ msgstr ""
 #: apt-pkg/contrib/cmndline.cc:278
 #, c-format
 msgid "Option %s requires an integer argument, not '%s'"
-msgstr "%s seçeneği bir tam sayı bağımsız değişkene gerek duyar, '%s' değil"
+msgstr ""
+"%s seçeneği bir tam sayı argümanının kullanımını gerektirir, '%s' değil"
 
 #: apt-pkg/contrib/cmndline.cc:309
 #, c-format
@@ -3254,49 +3251,49 @@ msgstr "Yapılandırma dosyası (%s) açılıyor"
 #: apt-pkg/contrib/configuration.cc:801
 #, c-format
 msgid "Syntax error %s:%u: Block starts with no name."
-msgstr "Sözdizim hatası %s:%u: Blok ad olmadan başlıyor."
+msgstr "Sözdizimi hatası %s:%u: Blok ad olmadan başlıyor."
 
 #: apt-pkg/contrib/configuration.cc:820
 #, c-format
 msgid "Syntax error %s:%u: Malformed tag"
-msgstr "Sözdizim hatası %s:%u: Kötü biçimlendirilmiş etiket"
+msgstr "Sözdizimi hatası %s:%u: Kötü biçimlendirilmiş etiket"
 
 #: apt-pkg/contrib/configuration.cc:837
 #, c-format
 msgid "Syntax error %s:%u: Extra junk after value"
-msgstr "Sözdizim hatası %s:%u: Değerden sonra ilave gereksiz"
+msgstr "Sözdizimi hatası %s:%u: Değerden sonra ilave gereksiz"
 
 #: apt-pkg/contrib/configuration.cc:877
 #, c-format
 msgid "Syntax error %s:%u: Directives can only be done at the top level"
-msgstr "Sözdizim hatası %s:%u: Yönergeler yalnızca en üst düzeyde bitebilir"
+msgstr "Sözdizimi hatası %s:%u: Yönergeler sadece en üst düzeyde bitebilir"
 
 #: apt-pkg/contrib/configuration.cc:884
 #, c-format
 msgid "Syntax error %s:%u: Too many nested includes"
-msgstr "Sözdizim hatası %s:%u: Çok fazla yuvalanmış 'include'"
+msgstr "Sözdizimi hatası %s:%u: Çok fazla yuvalanmış 'include'"
 
 #: apt-pkg/contrib/configuration.cc:888 apt-pkg/contrib/configuration.cc:893
 #, c-format
 msgid "Syntax error %s:%u: Included from here"
-msgstr "Sözdizim hatası %s:%u: Buradan 'include' edilmiş"
+msgstr "Sözdizimi hatası %s:%u: Buradan 'include' edilmiş"
 
 #: apt-pkg/contrib/configuration.cc:897
 #, c-format
 msgid "Syntax error %s:%u: Unsupported directive '%s'"
-msgstr "Sözdizim hatası %s:%u: Desteklenmeyen yönerge '%s'"
+msgstr "Sözdizimi hatası %s:%u: Desteklenmeyen yönerge '%s'"
 
 #: apt-pkg/contrib/configuration.cc:900
 #, c-format
 msgid "Syntax error %s:%u: clear directive requires an option tree as argument"
 msgstr ""
-"Sözdizim hatası %s:%u: clear yönergesi argüman olarak bir seçenek ağacı "
-"gerektirir."
+"Sözdizimi hatası %s:%u: clear yönergesi bir seçenek ağacı argümanını "
+"gerektirir"
 
 #: apt-pkg/contrib/configuration.cc:950
 #, c-format
 msgid "Syntax error %s:%u: Extra junk at end of file"
-msgstr "Sözdizim hatası %s:%u: Dosya sonunda ilave gereksiz"
+msgstr "Sözdizimi hatası %s:%u: Dosya sonunda ilave gereksiz"
 
 #: apt-pkg/contrib/fileutl.cc:190
 #, c-format
@@ -3327,13 +3324,13 @@ msgstr "'%s' dizin olmadığı için dosya listeli oluşturulamıyor"
 #, c-format
 msgid "Ignoring '%s' in directory '%s' as it is not a regular file"
 msgstr ""
-"'%2$s' dizinindeki '%1$s' normal bir dosya olmadığı için görmezden geliniyor."
+"'%2$s' dizinindeki '%1$s' normal bir dosya olmadığı için görmezden geliniyor"
 
 #: apt-pkg/contrib/fileutl.cc:412
 #, c-format
 msgid "Ignoring file '%s' in directory '%s' as it has no filename extension"
 msgstr ""
-"'%2$s' dizinindeki '%1$s' dosyası uzantısı olmadığı için görmezden geliniyor."
+"'%2$s' dizinindeki '%1$s' dosyası uzantısı olmadığı için görmezden geliniyor"
 
 #: apt-pkg/contrib/fileutl.cc:421
 #, c-format
@@ -3341,7 +3338,7 @@ msgid ""
 "Ignoring file '%s' in directory '%s' as it has an invalid filename extension"
 msgstr ""
 "'%2$s' dizinindeki '%1$s' dosyası geçersiz bir dosya uzantısı olduğu için "
-"yok sayılıyor."
+"yok sayılıyor"
 
 #: apt-pkg/contrib/fileutl.cc:824
 #, c-format
@@ -3351,7 +3348,7 @@ msgstr "%s altsüreci bir bölümleme hatası aldı (segmentation fault)."
 #: apt-pkg/contrib/fileutl.cc:826
 #, c-format
 msgid "Sub-process %s received signal %u."
-msgstr "%s altsüreci %u sinyali aldı"
+msgstr "%s altsüreci %u sinyali aldı."
 
 #: apt-pkg/contrib/fileutl.cc:830 apt-pkg/contrib/gpgv.cc:239
 #, c-format
@@ -3389,7 +3386,7 @@ msgstr "Sıkıştırma programı çalıştırılamadı "
 #: apt-pkg/contrib/fileutl.cc:1514
 #, c-format
 msgid "read, still have %llu to read but none left"
-msgstr "read, %llu bayt okunması gerekli fakat hiç kalmamış"
+msgstr "read, %llu bayt okunması gerekli ama hiç kalmamış"
 
 #: apt-pkg/contrib/fileutl.cc:1627 apt-pkg/contrib/fileutl.cc:1649
 #, c-format

+ 3 - 0
test/integration/framework

@@ -47,6 +47,9 @@ msgskip() { printf "${CWARNING}SKIP${CNORMAL}\n" >&2; }
 msgfail() {
 	if [ $# -gt 0 ]; then printf "${CFAIL}FAIL: $*${CNORMAL}\n" >&2;
 	else printf "${CFAIL}FAIL${CNORMAL}\n" >&2; fi
+        if [ -n "$APT_DEBUG_TESTS" ]; then
+            bash
+        fi
 	EXIT_CODE=$((EXIT_CODE+1));
 }
 

+ 7 - 0
test/integration/test-apt-key

@@ -41,7 +41,14 @@ gpg:              unchanged: 1' aptkey --fakeroot update
 
 	testaptkeys 'pub   2048R/DBAC8DAE 2010-08-18'
 
+	testsuccess test ! -e rootdir/etc/apt/trusted.gpg
 	testsuccess aptkey --fakeroot add ./keys/rexexpired.pub
+	msgtest 'Check if trusted.gpg is created with permissions set to' '0644'
+	if [ "$(stat -c '%a' rootdir/etc/apt/trusted.gpg )" = '644' ]; then
+		msgpass
+	else
+		msgfail
+	fi
 
 	testaptkeys 'pub   2048R/27CE74F9 2013-07-12 [expired: 2013-07-13]
 pub   2048R/DBAC8DAE 2010-08-18'

+ 2 - 2
test/integration/test-compressed-indexes

@@ -39,10 +39,10 @@ testrun() {
 		test -e rootdir/var/lib/apt/lists/*_Translation-en.${COMPRESS} || F=1
 		# there is no point in trying pdiff if we have compressed indexes
 		# as we can't patch compressed files (well, we can, but what is the point?)
-		! test -e rootdir/var/lib/apt/lists/*.IndexDiff || F=1
+		! test -e rootdir/var/lib/apt/lists/*diff_Index || F=1
 	else
 		# clear the faked pdiff indexes so the glob below works
-		rm -f rootdir/var/lib/apt/lists/*.IndexDiff
+		rm -f rootdir/var/lib/apt/lists/*diff_Index
 		test -e rootdir/var/lib/apt/lists/*_Packages || F=1
 		test -e rootdir/var/lib/apt/lists/*_Sources || F=1
 		test -e rootdir/var/lib/apt/lists/*_Translation-en || F=1

+ 43 - 7
test/integration/test-pdiff-usage

@@ -76,8 +76,15 @@ SHA1-History:
  9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
  $(sha1sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
 SHA1-Patches:
- 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
- $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
+ $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
+SHA256-Current: $(sha256sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new)
+SHA256-History:
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
+ $(sha256sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+SHA256-Patches:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
+ $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
 	generatereleasefiles '+1hour'
 	signreleasefiles
 	find aptarchive -name 'Packages*' -type f -delete
@@ -87,7 +94,7 @@ SHA1-Patches:
 " aptcache show apt newstuff
 
 	msgmsg "Testcase: index is already up-to-date: $*"
-	find rootdir/var/lib/apt/lists -name '*.IndexDiff' -type f -delete
+	find rootdir/var/lib/apt/lists -name '*diff_Index' -type f -delete
 	testsuccess aptget update "$@"
 	testequal "$(cat ${PKGFILE}-new)
 " aptcache show apt newstuff
@@ -119,9 +126,18 @@ SHA1-History:
  $(sha1sum ${PKGFILE} | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}) $(basename ${PATCHFILE})
  $(sha1sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new) $(basename ${PATCHFILE2})
 SHA1-Patches:
- 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
  $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
- $(sha1sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})" > $PATCHINDEX
+ $(sha1sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})
+SHA256-Current: $(sha256sum aptarchive/Packages | cut -d' ' -f 1) $(stat -c%s aptarchive/Packages)
+SHA256-History:
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
+ $(sha256sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+ $(sha256sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new) $(basename ${PATCHFILE2})
+SHA256-Patches:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
+ $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
+ $(sha256sum ${PATCHFILE2} | cut -d' ' -f 1) $(stat -c%s ${PATCHFILE2}) $(basename ${PATCHFILE2})" > $PATCHINDEX
 	generatereleasefiles '+2hour'
 	signreleasefiles
 	cp -a aptarchive/Packages Packages-future
@@ -147,8 +163,15 @@ SHA1-History:
  9f4148e06d7faa37062994ff10d0c842d7017513 33053002 2010-08-18-2013.28
  $(sha1sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
 SHA1-Patches:
- 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-0814.28
- $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
+ 7651fc0ac57cd83d41c63195a9342e2db5650257 19722 2010-08-18-2013.28
+ $(sha1sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)
+SHA256-Current: $(sha256sum ${PKGFILE}-new | cut -d' ' -f 1) $(stat -c%s ${PKGFILE}-new)
+SHA256-History:
+ 01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b 33053002 2010-08-18-2013.28
+ $(sha256sum $PKGFILE | cut -d' ' -f 1) $(stat -c%s $PKGFILE) $(basename $PATCHFILE)
+SHA256-Patches:
+ e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 19722 2010-08-18-2013.28
+ $(sha256sum $PATCHFILE | cut -d' ' -f 1) $(stat -c%s $PATCHFILE) $(basename $PATCHFILE)" > $PATCHINDEX
 	echo 'I am Mallory and I change files' >> $PATCHFILE
 	cat $PATCHFILE | gzip > ${PATCHFILE}.gz
 	generatereleasefiles '+1hour'
@@ -166,3 +189,16 @@ testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=1
 testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=1
 testrun -o Acquire::PDiffs::Merge=0 -o APT::Get::List-Cleanup=0
 testrun -o Acquire::PDiffs::Merge=1 -o APT::Get::List-Cleanup=0
+
+sha256sum() {
+	echo '01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -'
+}
+testrun -o Acquire::PDiffs::Merge=0 -o Acquire::ForceHash=SHA1
+testrun -o Acquire::PDiffs::Merge=1 -o Acquire::ForceHash=SHA1
+
+unset -f sha256sum
+sha1sum() {
+	echo 'adc83b19e793491b1c6ea0fd8b46cd9f32e592fc -'
+}
+testrun -o Acquire::PDiffs::Merge=0 -o Acquire::ForceHash=SHA256
+testrun -o Acquire::PDiffs::Merge=1 -o Acquire::ForceHash=SHA256