+ virtual string DescURI() {return RealURI; };
+
+ /** \brief Create a new pkgAcqMetaIndex. */
+ pkgAcqMetaIndex(pkgAcquire *Owner,
+ string URI,string URIDesc, string ShortDesc,
+ string SigFile,
+ const vector<struct IndexTarget*>* IndexTargets,
+ indexRecords* MetaIndexParser);
+};
+ /*}}}*/
+/** \brief An item that is responsible for fetching a package file. {{{
+ *
+ * If the package file already exists in the cache, nothing will be
+ * done.
+ */
+class pkgAcqArchive : public pkgAcquire::Item
+{
+ protected:
+ /** \brief The package version being fetched. */
+ 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
+ * download this package from.
+ */
+ pkgSourceList *Sources;
+
+ /** \brief A package records object, used to look up the file
+ * corresponding to each version of the package.
+ */
+ pkgRecords *Recs;
+
+ /** \brief The hashsum of this package. */
+ HashString ExpectedHash;
+
+ /** \brief A location in which the actual filename of the package
+ * should be stored.
+ */
+ string &StoreFilename;
+
+ /** \brief The next file for this version to try to download. */
+ pkgCache::VerFileIterator Vf;
+
+ /** \brief How many (more) times to try to find a new source from
+ * which to download this package version if it fails.
+ *
+ * Set from Acquire::Retries.
+ */
+ unsigned int Retries;
+
+ /** \brief \b true if this version file is being downloaded from a
+ * trusted source.
+ */
+ bool Trusted;
+
+ /** \brief Queue up the next available file for this version. */
+ bool QueueNext();
+
+ public:
+
+ virtual void Failed(string Message,pkgAcquire::MethodConfig *Cnf);
+ virtual void Done(string Message,unsigned long Size,string Hash,
+ pkgAcquire::MethodConfig *Cnf);
+ virtual string DescURI() {return Desc.URI;};
+ virtual string ShortDesc() {return Desc.ShortDesc;};
+ virtual void Finished();
+ virtual string HashSum() {return ExpectedHash.toStr(); };
+ virtual bool IsTrusted();
+
+ /** \brief Create a new pkgAcqArchive.
+ *
+ * \param Owner The pkgAcquire object with which this item is
+ * associated.
+ *
+ * \param Sources The sources from which to download version
+ * files.
+ *
+ * \param Recs A package records object, used to look up the file
+ * corresponding to each version of the package.
+ *
+ * \param Version The package version to download.
+ *
+ * \param StoreFilename A location in which the actual filename of
+ * the package should be stored. It will be set to a guessed
+ * basename in the constructor, and filled in with a fully
+ * qualified filename once the download finishes.
+ */
+ pkgAcqArchive(pkgAcquire *Owner,pkgSourceList *Sources,
+ pkgRecords *Recs,pkgCache::VerIterator const &Version,
+ string &StoreFilename);
+};
+ /*}}}*/
+/** \brief Retrieve an arbitrary file to the current directory. {{{
+ *
+ * The file is retrieved even if it is accessed via a URL type that
+ * normally is a NOP, such as "file". If the download fails, the
+ * partial file is renamed to get a ".FAILED" extension.
+ */
+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. */
+ HashString ExpectedHash;
+
+ /** \brief How many times to retry the download, set from
+ * Acquire::Retries.
+ */
+ unsigned int Retries;
+
+ /** \brief Should this file be considered a index file */
+ bool IsIndexFile;
+
+ public: