Просмотр исходного кода

promote ExpectedHashes to a pkgAcquire::Item member

Beside being another big API break with hopefully zero fallout in
reality it avoids having the same member and helper code in each and
every subclass.
David Kalnischkies лет назад: 12
Родитель
Сommit
fa3b260f43
2 измененных файлов с 40 добавлено и 102 удалено
  1. 23 26
      apt-pkg/acquire-item.cc
  2. 17 76
      apt-pkg/acquire-item.h

+ 23 - 26
apt-pkg/acquire-item.cc

@@ -64,12 +64,10 @@ static void printHashSumComparision(std::string const &URI, HashStringList const
 									/*}}}*/
 									/*}}}*/
 
 
 // Acquire::Item::Item - Constructor					/*{{{*/
 // Acquire::Item::Item - Constructor					/*{{{*/
-// ---------------------------------------------------------------------
-/* */
-pkgAcquire::Item::Item(pkgAcquire *Owner) : Owner(Owner), FileSize(0),
-                       PartialSize(0), Mode(0), ID(0), Complete(false), 
-                       Local(false), QueueCounter(0), 
-                       ExpectedAdditionalItems(0)
+pkgAcquire::Item::Item(pkgAcquire *Owner, HashStringList const &ExpectedHashes) :
+   Owner(Owner), FileSize(0), PartialSize(0), Mode(0), ID(0), Complete(false),
+   Local(false), QueueCounter(0), ExpectedAdditionalItems(0),
+   ExpectedHashes(ExpectedHashes)
 {
 {
    Owner->Add(this);
    Owner->Add(this);
    Status = StatIdle;
    Status = StatIdle;
@@ -243,7 +241,7 @@ void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
 pkgAcqSubIndex::pkgAcqSubIndex(pkgAcquire *Owner, string const &URI,
 pkgAcqSubIndex::pkgAcqSubIndex(pkgAcquire *Owner, string const &URI,
 				 string const &URIDesc, string const &ShortDesc,
 				 string const &URIDesc, string const &ShortDesc,
 				 HashStringList const &ExpectedHashes)
 				 HashStringList const &ExpectedHashes)
-   : Item(Owner), ExpectedHashes(ExpectedHashes)
+   : Item(Owner, ExpectedHashes)
 {
 {
    /* XXX: Beware: Currently this class does nothing (of value) anymore ! */
    /* XXX: Beware: Currently this class does nothing (of value) anymore ! */
    Debug = _config->FindB("Debug::pkgAcquire::SubIndex",false);
    Debug = _config->FindB("Debug::pkgAcquire::SubIndex",false);
@@ -356,10 +354,10 @@ bool pkgAcqSubIndex::ParseIndex(string const &IndexFile)		/*{{{*/
  * the original packages file
  * the original packages file
  */
  */
 pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner,
 pkgAcqDiffIndex::pkgAcqDiffIndex(pkgAcquire *Owner,
-      struct IndexTarget const * const Target,
+      IndexTarget const * const Target,
       HashStringList const &ExpectedHashes,
       HashStringList const &ExpectedHashes,
       indexRecords *MetaIndexParser)
       indexRecords *MetaIndexParser)
-   : Item(Owner), ExpectedHashes(ExpectedHashes), Target(Target),
+   : Item(Owner, ExpectedHashes), Target(Target),
      MetaIndexParser(MetaIndexParser)
      MetaIndexParser(MetaIndexParser)
 {
 {
    
    
@@ -622,7 +620,7 @@ pkgAcqIndexDiffs::pkgAcqIndexDiffs(pkgAcquire *Owner,
 				   HashStringList const &ExpectedHashes,
 				   HashStringList const &ExpectedHashes,
 				   string ServerSha1,
 				   string ServerSha1,
 				   vector<DiffInfo> diffs)
 				   vector<DiffInfo> diffs)
-   : Item(Owner), RealURI(URI), ExpectedHashes(ExpectedHashes),
+   : Item(Owner, ExpectedHashes), RealURI(URI),
      available_patches(diffs), ServerSha1(ServerSha1)
      available_patches(diffs), ServerSha1(ServerSha1)
 {
 {
    
    
@@ -653,8 +651,7 @@ void pkgAcqIndexDiffs::Failed(string Message,pkgAcquire::MethodConfig * /*Cnf*/)
    if(Debug)
    if(Debug)
       std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << " with " << Message << std::endl
       std::clog << "pkgAcqIndexDiffs failed: " << Desc.URI << " with " << Message << std::endl
 		<< "Falling back to normal index file acquire" << std::endl;
 		<< "Falling back to normal index file acquire" << std::endl;
-   new pkgAcqIndex(Owner, RealURI, Description,Desc.ShortDesc, 
-		   ExpectedHashes);
+   new pkgAcqIndex(Owner, RealURI, Description,Desc.ShortDesc, HashSums());
    Finish();
    Finish();
 }
 }
 									/*}}}*/
 									/*}}}*/
@@ -668,7 +665,7 @@ void pkgAcqIndexDiffs::Finish(bool allDone)
       DestFile = _config->FindDir("Dir::State::lists");
       DestFile = _config->FindDir("Dir::State::lists");
       DestFile += URItoFileName(RealURI);
       DestFile += URItoFileName(RealURI);
 
 
-      if(ExpectedHashes.usable() && !ExpectedHashes.VerifyFile(DestFile))
+      if(HashSums().usable() && !HashSums().VerifyFile(DestFile))
       {
       {
 	 RenameOnError(HashSumMismatch);
 	 RenameOnError(HashSumMismatch);
 	 Dequeue();
 	 Dequeue();
@@ -795,7 +792,7 @@ void pkgAcqIndexDiffs::Done(string Message,unsigned long long Size, HashStringLi
       // see if there is more to download
       // see if there is more to download
       if(available_patches.empty() == false) {
       if(available_patches.empty() == false) {
 	 new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
 	 new pkgAcqIndexDiffs(Owner, RealURI, Description, Desc.ShortDesc,
-			      ExpectedHashes, ServerSha1, available_patches);
+			      HashSums(), ServerSha1, available_patches);
 	 return Finish();
 	 return Finish();
       } else 
       } else 
 	 return Finish(true);
 	 return Finish(true);
@@ -808,7 +805,7 @@ pkgAcqIndexMergeDiffs::pkgAcqIndexMergeDiffs(pkgAcquire *Owner,
 				   string const &ShortDesc, HashStringList const &ExpectedHashes,
 				   string const &ShortDesc, HashStringList const &ExpectedHashes,
 				   DiffInfo const &patch,
 				   DiffInfo const &patch,
 				   std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
 				   std::vector<pkgAcqIndexMergeDiffs*> const * const allPatches)
-   : Item(Owner), RealURI(URI), ExpectedHashes(ExpectedHashes),
+   : Item(Owner, ExpectedHashes), RealURI(URI),
      patch(patch),allPatches(allPatches), State(StateFetchDiff)
      patch(patch),allPatches(allPatches), State(StateFetchDiff)
 {
 {
 
 
@@ -934,7 +931,7 @@ void pkgAcqIndexMergeDiffs::Done(string Message,unsigned long long Size,HashStri
 pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
 pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
 			 string URI,string URIDesc,string ShortDesc,
 			 string URI,string URIDesc,string ShortDesc,
 			 HashStringList const &ExpectedHashes, string comprExt)
 			 HashStringList const &ExpectedHashes, string comprExt)
-   : Item(Owner), RealURI(URI), ExpectedHashes(ExpectedHashes), Target(0),
+   : Item(Owner, ExpectedHashes), RealURI(URI), Target(0),
      MetaIndexParser(0)
      MetaIndexParser(0)
 {
 {
    if(comprExt.empty() == true)
    if(comprExt.empty() == true)
@@ -952,9 +949,9 @@ pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner,
 
 
    Init(URI, URIDesc, ShortDesc);
    Init(URI, URIDesc, ShortDesc);
 }
 }
-pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
+pkgAcqIndex::pkgAcqIndex(pkgAcquire *Owner, IndexTarget const * const Target,
 			 HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser)
 			 HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser)
-   : Item(Owner), RealURI(Target->URI), ExpectedHashes(ExpectedHashes)
+   : Item(Owner, ExpectedHashes), RealURI(Target->URI)
 {
 {
    // autoselect the compression method
    // autoselect the compression method
    std::vector<std::string> types = APT::Configuration::getCompressionTypes();
    std::vector<std::string> types = APT::Configuration::getCompressionTypes();
@@ -1209,7 +1206,7 @@ pkgAcqIndexTrans::pkgAcqIndexTrans(pkgAcquire *Owner,
   : pkgAcqIndex(Owner, URI, URIDesc, ShortDesc, HashStringList(), "")
   : pkgAcqIndex(Owner, URI, URIDesc, ShortDesc, HashStringList(), "")
 {
 {
 }
 }
-pkgAcqIndexTrans::pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
+pkgAcqIndexTrans::pkgAcqIndexTrans(pkgAcquire *Owner, IndexTarget const * const Target,
 			 HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser)
 			 HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser)
   : pkgAcqIndex(Owner, Target, ExpectedHashes, MetaIndexParser)
   : pkgAcqIndex(Owner, Target, ExpectedHashes, MetaIndexParser)
 {
 {
@@ -1265,7 +1262,7 @@ pkgAcqMetaSig::pkgAcqMetaSig(pkgAcquire *Owner,				/*{{{*/
 			     string MetaIndexShortDesc,
 			     string MetaIndexShortDesc,
 			     const vector<IndexTarget*>* IndexTargets,
 			     const vector<IndexTarget*>* IndexTargets,
 			     indexRecords* MetaIndexParser) :
 			     indexRecords* MetaIndexParser) :
-   Item(Owner), RealURI(URI), MetaIndexURI(MetaIndexURI),
+   Item(Owner, HashStringList()), RealURI(URI), MetaIndexURI(MetaIndexURI),
    MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),
    MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),
    MetaIndexParser(MetaIndexParser), IndexTargets(IndexTargets)
    MetaIndexParser(MetaIndexParser), IndexTargets(IndexTargets)
 {
 {
@@ -1410,9 +1407,9 @@ void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
 pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,			/*{{{*/
 pkgAcqMetaIndex::pkgAcqMetaIndex(pkgAcquire *Owner,			/*{{{*/
 				 string URI,string URIDesc,string ShortDesc,
 				 string URI,string URIDesc,string ShortDesc,
 				 string SigFile,
 				 string SigFile,
-				 const vector<struct IndexTarget*>* IndexTargets,
+				 const vector<IndexTarget*>* IndexTargets,
 				 indexRecords* MetaIndexParser) :
 				 indexRecords* MetaIndexParser) :
-   Item(Owner), RealURI(URI), SigFile(SigFile), IndexTargets(IndexTargets),
+   Item(Owner, HashStringList()), RealURI(URI), SigFile(SigFile), IndexTargets(IndexTargets),
    MetaIndexParser(MetaIndexParser), AuthPass(false), IMSHit(false)
    MetaIndexParser(MetaIndexParser), AuthPass(false), IMSHit(false)
 {
 {
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
    DestFile = _config->FindDir("Dir::State::lists") + "partial/";
@@ -1619,7 +1616,7 @@ void pkgAcqMetaIndex::QueueIndexes(bool verify)				/*{{{*/
    // at this point the real Items are loaded in the fetcher
    // at this point the real Items are loaded in the fetcher
    ExpectedAdditionalItems = 0;
    ExpectedAdditionalItems = 0;
 
 
-   for (vector <struct IndexTarget*>::const_iterator Target = IndexTargets->begin();
+   for (vector <IndexTarget*>::const_iterator Target = IndexTargets->begin();
         Target != IndexTargets->end();
         Target != IndexTargets->end();
         ++Target)
         ++Target)
    {
    {
@@ -1841,7 +1838,7 @@ pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire *Owner,		/*{{{*/
 		string const &URI, string const &URIDesc, string const &ShortDesc,
 		string const &URI, string const &URIDesc, string const &ShortDesc,
 		string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
 		string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
 		string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
 		string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
-		const vector<struct IndexTarget*>* IndexTargets,
+		const vector<IndexTarget*>* IndexTargets,
 		indexRecords* MetaIndexParser) :
 		indexRecords* MetaIndexParser) :
 	pkgAcqMetaIndex(Owner, URI, URIDesc, ShortDesc, "", IndexTargets, MetaIndexParser),
 	pkgAcqMetaIndex(Owner, URI, URIDesc, ShortDesc, "", IndexTargets, MetaIndexParser),
 	MetaIndexURI(MetaIndexURI), MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),
 	MetaIndexURI(MetaIndexURI), MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),
@@ -1926,7 +1923,7 @@ void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*
 pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
 pkgAcqArchive::pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
 			     pkgRecords *Recs,pkgCache::VerIterator const &Version,
 			     pkgRecords *Recs,pkgCache::VerIterator const &Version,
 			     string &StoreFilename) :
 			     string &StoreFilename) :
-               Item(Owner), Version(Version), Sources(Sources), Recs(Recs), 
+               Item(Owner, HashStringList()), Version(Version), Sources(Sources), Recs(Recs), 
                StoreFilename(StoreFilename), Vf(Version.FileList()), 
                StoreFilename(StoreFilename), Vf(Version.FileList()), 
 	       Trusted(false)
 	       Trusted(false)
 {
 {
@@ -2232,7 +2229,7 @@ pkgAcqFile::pkgAcqFile(pkgAcquire *Owner,string URI, HashStringList const &Hashe
 		       unsigned long long Size,string Dsc,string ShortDesc,
 		       unsigned long long Size,string Dsc,string ShortDesc,
 		       const string &DestDir, const string &DestFilename,
 		       const string &DestDir, const string &DestFilename,
                        bool IsIndexFile) :
                        bool IsIndexFile) :
-                       Item(Owner), ExpectedHashes(Hashes), IsIndexFile(IsIndexFile)
+                       Item(Owner, Hashes), IsIndexFile(IsIndexFile)
 {
 {
    Retries = _config->FindI("Acquire::Retries",0);
    Retries = _config->FindI("Acquire::Retries",0);
    
    

+ 17 - 76
apt-pkg/acquire-item.h

@@ -46,6 +46,7 @@
 class indexRecords;
 class indexRecords;
 class pkgRecords;
 class pkgRecords;
 class pkgSourceList;
 class pkgSourceList;
+class IndexTarget;
 
 
 /** \brief Represents the process by which a pkgAcquire object should	{{{
 /** \brief Represents the process by which a pkgAcquire object should	{{{
  *  retrieve a file or a collection of files.
  *  retrieve a file or a collection of files.
@@ -259,7 +260,7 @@ class pkgAcquire::Item : public WeakPointable
     *  \return the HashSums of this object, if applicable; otherwise, an
     *  \return the HashSums of this object, if applicable; otherwise, an
     *  empty list.
     *  empty list.
     */
     */
-   virtual HashStringList HashSums() const {return HashStringList();};
+   HashStringList HashSums() const {return ExpectedHashes;};
    std::string HashSum() const {HashStringList const hashes = HashSums(); HashString const * const hs = hashes.find(NULL); return hs != NULL ? hs->toStr() : ""; };
    std::string HashSum() const {HashStringList const hashes = HashSums(); HashString const * const hs = hashes.find(NULL); return hs != NULL ? hs->toStr() : ""; };
 
 
    /** \return the acquire process with which this item is associated. */
    /** \return the acquire process with which this item is associated. */
@@ -285,12 +286,10 @@ class pkgAcquire::Item : public WeakPointable
     *  process, but does not place it into any fetch queues (you must
     *  process, but does not place it into any fetch queues (you must
     *  manually invoke QueueURI() to do so).
     *  manually invoke QueueURI() to do so).
     *
     *
-    *  Initializes all fields of the item other than Owner to 0,
-    *  false, or the empty string.
-    *
     *  \param Owner The new owner of this item.
     *  \param Owner The new owner of this item.
+    *  \param ExpectedHashes of the file represented by this item
     */
     */
-   Item(pkgAcquire *Owner);
+   Item(pkgAcquire *Owner, HashStringList const &ExpectedHashes);
 
 
    /** \brief Remove this item from its owner's queue by invoking
    /** \brief Remove this item from its owner's queue by invoking
     *  pkgAcquire::Remove.
     *  pkgAcquire::Remove.
@@ -310,6 +309,12 @@ class pkgAcquire::Item : public WeakPointable
     * \param state respresenting the error we encountered
     * \param state respresenting the error we encountered
     */
     */
    bool RenameOnError(RenameOnErrorState const state);
    bool RenameOnError(RenameOnErrorState const state);
+
+   /** \brief The HashSums of the item is supposed to have than done */
+   HashStringList ExpectedHashes;
+
+   /** \brief The item that is currently being downloaded. */
+   pkgAcquire::ItemDesc Desc;
 };
 };
 									/*}}}*/
 									/*}}}*/
 /** \brief Information about an index patch (aka diff). */		/*{{{*/
 /** \brief Information about an index patch (aka diff). */		/*{{{*/
@@ -336,13 +341,6 @@ class pkgAcqSubIndex : public pkgAcquire::Item
    /** \brief If \b true, debugging information will be written to std::clog. */
    /** \brief If \b true, debugging information will be written to std::clog. */
    bool Debug;
    bool Debug;
 
 
-   /** \brief The item that is currently being downloaded. */
-   pkgAcquire::ItemDesc Desc;
-
-   /** \brief The Hashes that this file should have after download
-    */
-   HashStringList ExpectedHashes;
-
  public:
  public:
    // Specialized action members
    // Specialized action members
    virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
    virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
@@ -383,19 +381,11 @@ class pkgAcqDiffIndex : public pkgAcquire::Item
    /** \brief If \b true, debugging information will be written to std::clog. */
    /** \brief If \b true, debugging information will be written to std::clog. */
    bool Debug;
    bool Debug;
 
 
-   /** \brief The item that is currently being downloaded. */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief The URI of the index file to recreate at our end (either
    /** \brief The URI of the index file to recreate at our end (either
     *  by downloading it or by applying partial patches).
     *  by downloading it or by applying partial patches).
     */
     */
    std::string RealURI;
    std::string RealURI;
 
 
-   /** \brief The Hashes that the real index file should have after
-    *  all patches have been applied.
-    */
-   HashStringList ExpectedHashes;
-
    /** \brief The index file which will be patched to generate the new
    /** \brief The index file which will be patched to generate the new
     *  file.
     *  file.
     */
     */
@@ -470,21 +460,11 @@ class pkgAcqIndexMergeDiffs : public pkgAcquire::Item
     */
     */
    bool Debug;
    bool Debug;
 
 
-   /** \brief description of the item that is currently being
-    *  downloaded.
-    */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief URI of the package index file that is being
    /** \brief URI of the package index file that is being
     *  reconstructed.
     *  reconstructed.
     */
     */
    std::string RealURI;
    std::string RealURI;
 
 
-   /** \brief The Hashes that the real index file should have after
-    *  all patches have been applied.
-    */
-   HashStringList ExpectedHashes;
-
    /** \brief description of the file being downloaded. */
    /** \brief description of the file being downloaded. */
    std::string Description;
    std::string Description;
 
 
@@ -593,21 +573,11 @@ class pkgAcqIndexDiffs : public pkgAcquire::Item
     */
     */
    bool Debug;
    bool Debug;
 
 
-   /** \brief A description of the item that is currently being
-    *  downloaded.
-    */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief The URI of the package index file that is being
    /** \brief The URI of the package index file that is being
     *  reconstructed.
     *  reconstructed.
     */
     */
    std::string RealURI;
    std::string RealURI;
 
 
-   /** \brief The HashSums of the package index file that is being
-    *  reconstructed.
-    */
-   HashStringList ExpectedHashes;
-
    /** A description of the file being downloaded. */
    /** A description of the file being downloaded. */
    std::string Description;
    std::string Description;
 
 
@@ -712,19 +682,11 @@ class pkgAcqIndex : public pkgAcquire::Item
    //        the downloaded file contains the expected tag
    //        the downloaded file contains the expected tag
    bool Verify;
    bool Verify;
 
 
-   /** \brief The download request that is currently being
-    *   processed.
-    */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief The object that is actually being fetched (minus any
    /** \brief The object that is actually being fetched (minus any
     *  compression-related extensions).
     *  compression-related extensions).
     */
     */
    std::string RealURI;
    std::string RealURI;
 
 
-   /** \brief The expected hashsum of the decompressed index file. */
-   HashStringList ExpectedHashes;
-
    /** \brief The compression-related file extensions that are being
    /** \brief The compression-related file extensions that are being
     *  added to the downloaded file one by one if first fails (e.g., "gz bz2").
     *  added to the downloaded file one by one if first fails (e.g., "gz bz2").
     */
     */
@@ -743,7 +705,6 @@ class pkgAcqIndex : public pkgAcquire::Item
 		     pkgAcquire::MethodConfig *Cnf);
 		     pkgAcquire::MethodConfig *Cnf);
    virtual std::string Custom600Headers() const;
    virtual std::string Custom600Headers() const;
    virtual std::string DescURI() const {return Desc.URI;};
    virtual std::string DescURI() const {return Desc.URI;};
-   virtual HashStringList HashSums() const {return ExpectedHashes; };
 
 
    /** \brief Create a pkgAcqIndex.
    /** \brief Create a pkgAcqIndex.
     *
     *
@@ -767,7 +728,7 @@ class pkgAcqIndex : public pkgAcquire::Item
    pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
    pkgAcqIndex(pkgAcquire *Owner,std::string URI,std::string URIDesc,
 	       std::string ShortDesc, HashStringList const &ExpectedHashes,
 	       std::string ShortDesc, HashStringList const &ExpectedHashes,
 	       std::string compressExt="");
 	       std::string compressExt="");
-   pkgAcqIndex(pkgAcquire *Owner, struct IndexTarget const * const Target,
+   pkgAcqIndex(pkgAcquire *Owner, IndexTarget const * const Target,
 			 HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser);
 			 HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser);
    void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
    void Init(std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc);
 };
 };
@@ -799,7 +760,7 @@ class pkgAcqIndexTrans : public pkgAcqIndex
     */
     */
    pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
    pkgAcqIndexTrans(pkgAcquire *Owner,std::string URI,std::string URIDesc,
 		    std::string ShortDesc);
 		    std::string ShortDesc);
-   pkgAcqIndexTrans(pkgAcquire *Owner, struct IndexTarget const * const Target,
+   pkgAcqIndexTrans(pkgAcquire *Owner, IndexTarget const * const Target,
 		    HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser);
 		    HashStringList const &ExpectedHashes, indexRecords *MetaIndexParser);
 };
 };
 									/*}}}*/
 									/*}}}*/
@@ -868,9 +829,6 @@ class pkgAcqMetaSig : public pkgAcquire::Item
    /** \brief The last good signature file */
    /** \brief The last good signature file */
    std::string LastGoodSig;
    std::string LastGoodSig;
 
 
-   /** \brief The fetch request that is currently being processed. */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief The URI of the signature file.  Unlike Desc.URI, this is
    /** \brief The URI of the signature file.  Unlike Desc.URI, this is
     *  never modified; it is used to determine the file that is being
     *  never modified; it is used to determine the file that is being
     *  downloaded.
     *  downloaded.
@@ -898,7 +856,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item
     *
     *
     *  \todo Why a list of pointers instead of a list of structs?
     *  \todo Why a list of pointers instead of a list of structs?
     */
     */
-   const std::vector<struct IndexTarget*>* IndexTargets;
+   const std::vector<IndexTarget*>* IndexTargets;
 
 
    public:
    public:
    
    
@@ -912,7 +870,7 @@ class pkgAcqMetaSig : public pkgAcquire::Item
    /** \brief Create a new pkgAcqMetaSig. */
    /** \brief Create a new pkgAcqMetaSig. */
    pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
    pkgAcqMetaSig(pkgAcquire *Owner,std::string URI,std::string URIDesc, std::string ShortDesc,
 		 std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
 		 std::string MetaIndexURI, std::string MetaIndexURIDesc, std::string MetaIndexShortDesc,
-		 const std::vector<struct IndexTarget*>* IndexTargets,
+		 const std::vector<IndexTarget*>* IndexTargets,
 		 indexRecords* MetaIndexParser);
 		 indexRecords* MetaIndexParser);
    virtual ~pkgAcqMetaSig();
    virtual ~pkgAcqMetaSig();
 };
 };
@@ -930,9 +888,6 @@ class pkgAcqMetaSig : public pkgAcquire::Item
 class pkgAcqMetaIndex : public pkgAcquire::Item
 class pkgAcqMetaIndex : public pkgAcquire::Item
 {
 {
    protected:
    protected:
-   /** \brief The fetch command that is currently being processed. */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief The URI that is actually being downloaded; never
    /** \brief The URI that is actually being downloaded; never
     *  modified by pkgAcqMetaIndex.
     *  modified by pkgAcqMetaIndex.
     */
     */
@@ -946,7 +901,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
    std::string SigFile;
    std::string SigFile;
 
 
    /** \brief The index files to download. */
    /** \brief The index files to download. */
-   const std::vector<struct IndexTarget*>* IndexTargets;
+   const std::vector<IndexTarget*>* IndexTargets;
 
 
    /** \brief The parser for the meta-index file. */
    /** \brief The parser for the meta-index file. */
    indexRecords* MetaIndexParser;
    indexRecords* MetaIndexParser;
@@ -1009,7 +964,7 @@ class pkgAcqMetaIndex : public pkgAcquire::Item
    pkgAcqMetaIndex(pkgAcquire *Owner,
    pkgAcqMetaIndex(pkgAcquire *Owner,
 		   std::string URI,std::string URIDesc, std::string ShortDesc,
 		   std::string URI,std::string URIDesc, std::string ShortDesc,
 		   std::string SigFile,
 		   std::string SigFile,
-		   const std::vector<struct IndexTarget*>* IndexTargets,
+		   const std::vector<IndexTarget*>* IndexTargets,
 		   indexRecords* MetaIndexParser);
 		   indexRecords* MetaIndexParser);
 };
 };
 									/*}}}*/
 									/*}}}*/
@@ -1043,7 +998,7 @@ public:
 		std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
 		std::string const &URI, std::string const &URIDesc, std::string const &ShortDesc,
 		std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
 		std::string const &MetaIndexURI, std::string const &MetaIndexURIDesc, std::string const &MetaIndexShortDesc,
 		std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
 		std::string const &MetaSigURI, std::string const &MetaSigURIDesc, std::string const &MetaSigShortDesc,
-		const std::vector<struct IndexTarget*>* IndexTargets,
+		const std::vector<IndexTarget*>* IndexTargets,
 		indexRecords* MetaIndexParser);
 		indexRecords* MetaIndexParser);
    virtual ~pkgAcqMetaClearSig();
    virtual ~pkgAcqMetaClearSig();
 };
 };
@@ -1059,9 +1014,6 @@ class pkgAcqArchive : public pkgAcquire::Item
    /** \brief The package version being fetched. */
    /** \brief The package version being fetched. */
    pkgCache::VerIterator Version;
    pkgCache::VerIterator Version;
 
 
-   /** \brief The fetch command that is currently being processed. */
-   pkgAcquire::ItemDesc Desc;
-
    /** \brief The list of sources from which to pick archives to
    /** \brief The list of sources from which to pick archives to
     *  download this package from.
     *  download this package from.
     */
     */
@@ -1072,9 +1024,6 @@ class pkgAcqArchive : public pkgAcquire::Item
     */
     */
    pkgRecords *Recs;
    pkgRecords *Recs;
 
 
-   /** \brief The hashsum of this package. */
-   HashStringList ExpectedHashes;
-
    /** \brief A location in which the actual filename of the package
    /** \brief A location in which the actual filename of the package
     *  should be stored.
     *  should be stored.
     */
     */
@@ -1106,7 +1055,6 @@ class pkgAcqArchive : public pkgAcquire::Item
    virtual std::string DescURI() const {return Desc.URI;};
    virtual std::string DescURI() const {return Desc.URI;};
    virtual std::string ShortDesc() const {return Desc.ShortDesc;};
    virtual std::string ShortDesc() const {return Desc.ShortDesc;};
    virtual void Finished();
    virtual void Finished();
-   virtual HashStringList HashSums() const {return ExpectedHashes; };
    virtual bool IsTrusted() const;
    virtual bool IsTrusted() const;
    
    
    /** \brief Create a new pkgAcqArchive.
    /** \brief Create a new pkgAcqArchive.
@@ -1140,12 +1088,6 @@ class pkgAcqArchive : public pkgAcquire::Item
  */
  */
 class pkgAcqFile : public pkgAcquire::Item
 class pkgAcqFile : public pkgAcquire::Item
 {
 {
-   /** \brief The currently active download process. */
-   pkgAcquire::ItemDesc Desc;
-
-   /** \brief The hashsum of the file to download, if it is known. */
-   HashStringList ExpectedHashes;
-
    /** \brief How many times to retry the download, set from
    /** \brief How many times to retry the download, set from
     *  Acquire::Retries.
     *  Acquire::Retries.
     */
     */
@@ -1161,7 +1103,6 @@ class pkgAcqFile : public pkgAcquire::Item
    virtual void Done(std::string Message,unsigned long long Size, HashStringList const &CalcHashes,
    virtual void Done(std::string Message,unsigned long long Size, HashStringList const &CalcHashes,
 		     pkgAcquire::MethodConfig *Cnf);
 		     pkgAcquire::MethodConfig *Cnf);
    virtual std::string DescURI() const {return Desc.URI;};
    virtual std::string DescURI() const {return Desc.URI;};
-   virtual HashStringList HashSums() const { return ExpectedHashes; };
    virtual std::string Custom600Headers() const;
    virtual std::string Custom600Headers() const;
 
 
    /** \brief Create a new pkgAcqFile object.
    /** \brief Create a new pkgAcqFile object.