/** \brief If not \b NULL, contains the name of a subprocess that
* is operating on this object (for instance, "gzip" or "gpgv").
*/
- APT_DEPRECATED const char *Mode;
+ APT_DEPRECATED_MSG("Use the std::string member ActiveSubprocess instead") const char *Mode;
/** \brief contains the name of the subprocess that is operating on this object
* (for instance, "gzip", "rred" or "gpgv"). This is obsoleting #Mode from above
*/
virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf);
+ /** \brief Invoked by the acquire worker to check if the successfully
+ * fetched object is also the objected we wanted to have.
+ *
+ * Note that the object might \e not have been written to
+ * DestFile; check for the presence of an Alt-Filename entry in
+ * Message to find the file to which it was really written.
+ *
+ * This is called before Done is called and can prevent it by returning
+ * \b false which will result in Failed being called instead.
+ *
+ * You should prefer to use this method over calling Failed() from Done()
+ * as this has e.g. the wrong progress reporting.
+ *
+ * \param Message Data from the acquire method. Use LookupTag()
+ * to parse it.
+ * \param Cnf The method via which the object was fetched.
+ *
+ * \sa pkgAcqMethod
+ */
+ virtual bool VerifyDone(std::string const &Message,
+ pkgAcquire::MethodConfig const * const Cnf);
+
/** \brief Invoked by the acquire worker when the object was
* fetched successfully.
*
*
* \param FailCode A short failure string that is send
*/
- void ReportMirrorFailure(std::string const &FailCode);
+ APT_DEPRECATED_MSG("Item::Failed does this for you") void ReportMirrorFailure(std::string const &FailCode);
/** \brief Set the name of the current active subprocess
*
pkgAcqMetaClearSig * const TransactionManager;
enum TransactionStates {
+ TransactionStarted,
TransactionCommit,
TransactionAbort,
};
/** \brief The index files which should be looked up in the meta-index
* and then downloaded.
*/
- std::vector<IndexTarget> const IndexTargets;
+ std::vector<IndexTarget> IndexTargets;
/** \brief If \b true, the index's signature is currently being verified.
*/
public:
// This refers more to the Transaction-Manager than the actual file
bool IMSHit;
+ TransactionStates State;
+ std::string BaseURI;
virtual bool QueueURI(pkgAcquire::ItemDesc &Item) APT_OVERRIDE;
virtual HashStringList GetExpectedHashes() const APT_OVERRIDE;
virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
virtual void Done(std::string const &Message, HashStringList const &Hashes,
pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
- virtual void Finished() APT_OVERRIDE;
/** \brief Create a new pkgAcqMetaIndex. */
pkgAcqMetaIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
virtual std::string Custom600Headers() const APT_OVERRIDE;
+ virtual bool VerifyDone(std::string const &Message, pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
virtual void Done(std::string const &Message, HashStringList const &Hashes,
pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
+ virtual void Finished() APT_OVERRIDE;
/** \brief Create a new pkgAcqMetaClearSig. */
pkgAcqMetaClearSig(pkgAcquire * const Owner,
public:
/** \brief Get the full pathname of the final file for the current URI */
virtual std::string GetFinalFilename() const APT_OVERRIDE;
+ virtual void Failed(std::string const &Message,pkgAcquire::MethodConfig const * const Cnf) APT_OVERRIDE;
pkgAcqBaseIndex(pkgAcquire * const Owner, pkgAcqMetaClearSig * const TransactionManager,
IndexTarget const &Target);
/** The current status of this patch. */
enum DiffState
- {
- /** \brief The diff is in an unknown state. */
- StateFetchUnkown,
-
+ {
/** \brief The diff is currently being fetched. */
StateFetchDiff,
AllStages Stage;
/** \brief Handle what needs to be done when the download is done */
- void StageDownloadDone(std::string const &Message,
- HashStringList const &Hashes,
- pkgAcquire::MethodConfig const * const Cfg);
+ void StageDownloadDone(std::string const &Message);
/** \brief Handle what needs to be done when the decompression/copy is
* done
*/
- void StageDecompressDone(std::string const &Message,
- HashStringList const &Hashes,
- pkgAcquire::MethodConfig const * const Cfg);
+ void StageDecompressDone();
/** \brief If \b set, this partially downloaded file will be
* removed when the download completes.
/** \brief Do the changes needed to fetch via AptByHash (if needed) */
void InitByHashIfNeeded();
- /** \brief Auto select the right compression to use */
- void AutoSelectCompression();
-
- /** \brief Schedule file for verification after a IMS hit */
- void ReverifyAfterIMS();
-
/** \brief Get the full pathname of the final file for the current URI */
virtual std::string GetFinalFilename() const APT_OVERRIDE;
*/
class pkgAcqChangelog : public pkgAcquire::Item
{
- void * const d;
+ class Private;
+ Private * const d;
std::string TemporaryDirectory;
std::string const SrcName;
std::string const SrcVersion;
/** returns the URI to the changelog of this version
*
- * \param Template URI where CHANGEPATH has to be filled in
+ * \param Template URI where @CHANGEPATH@ has to be filled in
* \param Component in which the package resides, can be empty
* \param SrcName is the source package name
* \param SrcVersion is the source package version