Calculating the final name of an item which it will have after
everything is done and verified successfully is suprisingly complicated
as while they all follow a simple pattern, the URI and where it is
stored varies between the items.
With some (abibreaking) redesign we can abstract this similar to how it
is already down for the partial file location.
Git-Dch: Ignore
return GetPartialFileName(URItoFileName(uri));
}
/*}}}*/
return GetPartialFileName(URItoFileName(uri));
}
/*}}}*/
+static std::string GetFinalFileNameFromURI(std::string const &uri) /*{{{*/
+{
+ return _config->FindDir("Dir::State::lists") + URItoFileName(uri);
+}
+ /*}}}*/
static std::string GetCompressedFileName(std::string const &URI, std::string const &Name, std::string const &Ext) /*{{{*/
{
if (Ext.empty() || Ext == "uncompressed")
static std::string GetCompressedFileName(std::string const &URI, std::string const &Name, std::string const &Ext) /*{{{*/
{
if (Ext.empty() || Ext == "uncompressed")
APT_IGNORE_DEPRECATED(Mode = ActiveSubprocess.c_str();)
}
/*}}}*/
APT_IGNORE_DEPRECATED(Mode = ActiveSubprocess.c_str();)
}
/*}}}*/
+// Acquire::Item::GetFinalFilename - Return the full final file path /*{{{*/
+std::string pkgAcquire::Item::GetFinalFilename() const
+{
+ return GetFinalFileNameFromURI(Desc.URI);
+}
+ /*}}}*/
// Acquire::Item::ReportMirrorFailure /*{{{*/
// ---------------------------------------------------------------------
void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
// Acquire::Item::ReportMirrorFailure /*{{{*/
// ---------------------------------------------------------------------
void pkgAcquire::Item::ReportMirrorFailure(string FailCode)
std::clog << "pkgAcqDiffIndex: " << Desc.URI << std::endl;
// look for the current package file
std::clog << "pkgAcqDiffIndex: " << Desc.URI << std::endl;
// look for the current package file
- CurrentPackagesFile = _config->FindDir("Dir::State::lists");
- CurrentPackagesFile += URItoFileName(RealURI);
+ CurrentPackagesFile = GetFinalFileNameFromURI(RealURI);
// FIXME: this file:/ check is a hack to prevent fetching
// from local sources. this is really silly, and
// FIXME: this file:/ check is a hack to prevent fetching
// from local sources. this is really silly, and
+}
+ /*}}}*/
+// Acquire::Item::GetFinalFilename - Return the full final file path /*{{{*/
+std::string pkgAcqDiffIndex::GetFinalFilename() const
+{
+ // the logic we inherent from pkgAcqBaseIndex isn't what we need here
+ return pkgAcquire::Item::GetFinalFilename();
}
/*}}}*/
// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/
}
/*}}}*/
// AcqIndex::Custom600Headers - Insert custom request headers /*{{{*/
string pkgAcqDiffIndex::Custom600Headers()
#endif
{
string pkgAcqDiffIndex::Custom600Headers()
#endif
{
- string Final = _config->FindDir("Dir::State::lists");
- Final += URItoFileName(Desc.URI);
+ string const Final = GetFinalFilename();
if(Debug)
std::clog << "Custom600Header-IMS: " << Final << std::endl;
if(Debug)
std::clog << "Custom600Header-IMS: " << Final << std::endl;
- string FinalFile;
- FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(Desc.URI);
-
+ string const FinalFile = GetFinalFilename();
if(StringToBool(LookupTag(Message,"IMS-Hit"),false))
DestFile = FinalFile;
if(StringToBool(LookupTag(Message,"IMS-Hit"),false))
DestFile = FinalFile;
if(available_patches.empty() == true)
{
// we are done (yeah!), check hashes against the final file
if(available_patches.empty() == true)
{
// we are done (yeah!), check hashes against the final file
- DestFile = _config->FindDir("Dir::State::lists");
- DestFile += URItoFileName(Target->URI);
+ DestFile = GetFinalFileNameFromURI(Target->URI);
- // queue for copy
- std::string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
- TransactionManager->TransactionStageCopy(this, DestFile, FinalFile);
+ TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename());
// this is for the "real" finish
Complete = true;
// this is for the "real" finish
Complete = true;
- std::string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
-
// move the result into place
// move the result into place
+ std::string const FinalFile = GetFinalFilename();
if(Debug)
std::clog << "Queue patched file in place: " << std::endl
<< DestFile << " -> " << FinalFile << std::endl;
if(Debug)
std::clog << "Queue patched file in place: " << std::endl
<< DestFile << " -> " << FinalFile << std::endl;
+// AcqBaseIndex::GetFinalFilename - Return the full final file path /*{{{*/
+std::string pkgAcqBaseIndex::GetFinalFilename() const
+{
+ return GetFinalFileNameFromURI(RealURI);
+}
+ /*}}}*/
// AcqIndex::AcqIndex - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* The package file is added to the queue and a second class is
// AcqIndex::AcqIndex - Constructor /*{{{*/
// ---------------------------------------------------------------------
/* The package file is added to the queue and a second class is
// pkgAcqIndex::GetFinalFilename - Return the full final file path /*{{{*/
std::string pkgAcqIndex::GetFinalFilename() const
{
// pkgAcqIndex::GetFinalFilename - Return the full final file path /*{{{*/
std::string pkgAcqIndex::GetFinalFilename() const
{
- std::string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
+ std::string const FinalFile = GetFinalFileNameFromURI(RealURI);
return GetCompressedFileName(RealURI, FinalFile, CurrentCompressionExtension);
}
/*}}}*/
return GetCompressedFileName(RealURI, FinalFile, CurrentCompressionExtension);
}
/*}}}*/
const std::string &FinalFile)
{
I->PartialFile = "";
const std::string &FinalFile)
{
I->PartialFile = "";
- I->DestFile = FinalFile;
+ I->DestFile = FinalFile;
}
/*}}}*/
// AcqMetaBase::GenerateAuthWarning - Check gpg authentication error /*{{{*/
}
/*}}}*/
// AcqMetaBase::GenerateAuthWarning - Check gpg authentication error /*{{{*/
-bool pkgAcqMetaBase::CheckStopAuthentication(const std::string &RealURI,
- const std::string &Message)
+bool pkgAcqMetaBase::CheckStopAuthentication(const std::string &Message)
{
// FIXME: this entire function can do now that we disallow going to
// a unauthenticated state and can cleanly rollback
{
// FIXME: this entire function can do now that we disallow going to
// a unauthenticated state and can cleanly rollback
- string Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
-
+ string const Final = GetFinalFilename();
if(FileExists(Final))
{
Status = StatTransientNetworkError;
if(FileExists(Final))
{
Status = StatTransientNetworkError;
string MetaIndexFile,
const vector<IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser) :
string MetaIndexFile,
const vector<IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser) :
- pkgAcqMetaBase(Owner, IndexTargets, MetaIndexParser,
+ pkgAcqMetaBase(Owner, IndexTargets, MetaIndexParser, URI,
HashStringList(), TransactionManager),
HashStringList(), TransactionManager),
- RealURI(URI), MetaIndexFile(MetaIndexFile), URIDesc(URIDesc),
+ MetaIndexFile(MetaIndexFile), URIDesc(URIDesc),
- DestFile = _config->FindDir("Dir::State::lists") + "partial/";
- DestFile += URItoFileName(RealURI);
+ DestFile = GetPartialFileNameFromURI(RealURI);
// remove any partial downloaded sig-file in partial/.
// it may confuse proxies and is too small to warrant a
// remove any partial downloaded sig-file in partial/.
// it may confuse proxies and is too small to warrant a
/*}}}*/
pkgAcqMetaSig::~pkgAcqMetaSig() /*{{{*/
{
/*}}}*/
pkgAcqMetaSig::~pkgAcqMetaSig() /*{{{*/
{
-}
- /*}}}*/
-// pkgAcqMetaSig::Custom600Headers - Insert custom request headers /*{{{*/
-// ---------------------------------------------------------------------
-#if APT_PKG_ABI >= 413
-string pkgAcqMetaSig::Custom600Headers() const
-#else
-string pkgAcqMetaSig::Custom600Headers()
-#endif
-{
- std::string Header = GetCustom600Headers(RealURI);
- return Header;
}
/*}}}*/
// pkgAcqMetaSig::Done - The signature was downloaded/verified /*{{{*/
}
/*}}}*/
// pkgAcqMetaSig::Done - The signature was downloaded/verified /*{{{*/
- if(CheckDownloadDone(Message, RealURI) == true)
+ if(CheckDownloadDone(Message) == true)
{
// destfile will be modified to point to MetaIndexFile for the
// gpgv method, so we need to save it here
{
// destfile will be modified to point to MetaIndexFile for the
// gpgv method, so we need to save it here
- else
- {
- if(CheckAuthDone(Message, RealURI) == true)
- {
- std::string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
- TransactionManager->TransactionStageCopy(this, MetaIndexFileSignature, FinalFile);
- }
- }
+ else if(CheckAuthDone(Message) == true)
+ TransactionManager->TransactionStageCopy(this, MetaIndexFileSignature, GetFinalFilename());
}
/*}}}*/
void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
}
/*}}}*/
void pkgAcqMetaSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf)/*{{{*/
Item::Failed(Message,Cnf);
// check if we need to fail at this point
Item::Failed(Message,Cnf);
// check if we need to fail at this point
- if (AuthPass == true && CheckStopAuthentication(RealURI, Message))
+ if (AuthPass == true && CheckStopAuthentication(Message))
return;
// FIXME: meh, this is not really elegant
return;
// FIXME: meh, this is not really elegant
- string const Final = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
+ string const Final = GetFinalFileNameFromURI(RealURI);
string const InReleaseURI = RealURI.replace(RealURI.rfind("Release.gpg"), 12,
"InRelease");
string const InReleaseURI = RealURI.replace(RealURI.rfind("Release.gpg"), 12,
"InRelease");
- string const FinalInRelease = _config->FindDir("Dir::State::lists") + URItoFileName(InReleaseURI);
+ string const FinalInRelease = GetFinalFileNameFromURI(InReleaseURI);
if (RealFileExists(Final) || RealFileExists(FinalInRelease))
{
if (RealFileExists(Final) || RealFileExists(FinalInRelease))
{
// we parse the indexes here because at this point the user wanted
// a repository that may potentially harm him
MetaIndexParser->Load(MetaIndexFile);
// we parse the indexes here because at this point the user wanted
// a repository that may potentially harm him
MetaIndexParser->Load(MetaIndexFile);
- if (!VerifyVendor(Message, RealURI))
+ if (!VerifyVendor(Message))
/* expired Release files are still a problem you need extra force for */;
else
QueueIndexes(true);
/* expired Release files are still a problem you need extra force for */;
else
QueueIndexes(true);
string MetaIndexSigURI,string MetaIndexSigURIDesc, string MetaIndexSigShortDesc,
const vector<IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser) :
string MetaIndexSigURI,string MetaIndexSigURIDesc, string MetaIndexSigShortDesc,
const vector<IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser) :
- pkgAcqMetaBase(Owner, IndexTargets, MetaIndexParser, HashStringList(),
+ pkgAcqMetaBase(Owner, IndexTargets, MetaIndexParser, URI, HashStringList(),
- RealURI(URI), URIDesc(URIDesc), ShortDesc(ShortDesc),
+ URIDesc(URIDesc), ShortDesc(ShortDesc),
MetaIndexSigURI(MetaIndexSigURI), MetaIndexSigURIDesc(MetaIndexSigURIDesc),
MetaIndexSigShortDesc(MetaIndexSigShortDesc)
{
MetaIndexSigURI(MetaIndexSigURI), MetaIndexSigURIDesc(MetaIndexSigURIDesc),
MetaIndexSigShortDesc(MetaIndexSigShortDesc)
{
QueueURI(Desc);
}
/*}}}*/
QueueURI(Desc);
}
/*}}}*/
-// pkgAcqMetaIndex::Custom600Headers - Insert custom request headers /*{{{*/
-// ---------------------------------------------------------------------
-#if APT_PKG_ABI >= 413
-string pkgAcqMetaIndex::Custom600Headers() const
-#else
-string pkgAcqMetaIndex::Custom600Headers()
-#endif
-{
- return GetCustom600Headers(RealURI);
-}
- /*}}}*/
void pkgAcqMetaIndex::Done(string Message,unsigned long long Size, /*{{{*/
HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cfg)
{
Item::Done(Message,Size,Hashes,Cfg);
void pkgAcqMetaIndex::Done(string Message,unsigned long long Size, /*{{{*/
HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cfg)
{
Item::Done(Message,Size,Hashes,Cfg);
- if(CheckDownloadDone(Message, RealURI))
+ if(CheckDownloadDone(Message))
{
// we have a Release file, now download the Signature, all further
// verify/queue for additional downloads will be done in the
{
// we have a Release file, now download the Signature, all further
// verify/queue for additional downloads will be done in the
MetaIndexSigShortDesc, MetaIndexFile, IndexTargets,
MetaIndexParser);
MetaIndexSigShortDesc, MetaIndexFile, IndexTargets,
MetaIndexParser);
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
- TransactionManager->TransactionStageCopy(this, DestFile, FinalFile);
+ TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename());
-bool pkgAcqMetaBase::CheckAuthDone(string Message, const string &RealURI) /*{{{*/
+bool pkgAcqMetaBase::CheckAuthDone(string Message) /*{{{*/
{
// At this point, the gpgv method has succeeded, so there is a
// valid signature from a key in the trusted keyring. We
{
// At this point, the gpgv method has succeeded, so there is a
// valid signature from a key in the trusted keyring. We
- if (!VerifyVendor(Message, RealURI))
+ if (!VerifyVendor(Message))
{
Status = StatAuthError;
return false;
{
Status = StatAuthError;
return false;
-// pkgAcqMetaBase::GetCustom600Headers - Get header for AcqMetaBase /*{{{*/
+// pkgAcqMetaBase::Custom600Headers - Get header for AcqMetaBase /*{{{*/
// ---------------------------------------------------------------------
// ---------------------------------------------------------------------
-string pkgAcqMetaBase::GetCustom600Headers(const string &RealURI) const
+#if APT_PKG_ABI >= 413
+string pkgAcqMetaBase::Custom600Headers() const
+#else
+string pkgAcqMetaBase::Custom600Headers()
+#endif
{
std::string Header = "\nIndex-File: true";
std::string MaximumSize;
{
std::string Header = "\nIndex-File: true";
std::string MaximumSize;
_config->FindI("Acquire::MaxReleaseFileSize", 10*1000*1000));
Header += MaximumSize;
_config->FindI("Acquire::MaxReleaseFileSize", 10*1000*1000));
Header += MaximumSize;
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
+ string const FinalFile = GetFinalFilename();
struct stat Buf;
if (stat(FinalFile.c_str(),&Buf) == 0)
struct stat Buf;
if (stat(FinalFile.c_str(),&Buf) == 0)
+// pkgAcqMetaBase::GetFinalFilename - Return the full final file path /*{{{*/
+std::string pkgAcqMetaBase::GetFinalFilename() const
+{
+ return GetFinalFileNameFromURI(RealURI);
+}
+ /*}}}*/
// pkgAcqMetaBase::QueueForSignatureVerify /*{{{*/
void pkgAcqMetaBase::QueueForSignatureVerify(const std::string &MetaIndexFile,
const std::string &MetaIndexFileSignature)
// pkgAcqMetaBase::QueueForSignatureVerify /*{{{*/
void pkgAcqMetaBase::QueueForSignatureVerify(const std::string &MetaIndexFile,
const std::string &MetaIndexFileSignature)
}
/*}}}*/
// pkgAcqMetaBase::CheckDownloadDone /*{{{*/
}
/*}}}*/
// pkgAcqMetaBase::CheckDownloadDone /*{{{*/
-bool pkgAcqMetaBase::CheckDownloadDone(const std::string &Message,
- const std::string &RealURI)
+bool pkgAcqMetaBase::CheckDownloadDone(const std::string &Message)
{
// We have just finished downloading a Release file (it is not
// verified yet)
{
// We have just finished downloading a Release file (it is not
// verified yet)
// make sure to verify against the right file on I-M-S hit
IMSHit = StringToBool(LookupTag(Message,"IMS-Hit"),false);
if(IMSHit)
// make sure to verify against the right file on I-M-S hit
IMSHit = StringToBool(LookupTag(Message,"IMS-Hit"),false);
if(IMSHit)
- {
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
- DestFile = FinalFile;
- }
+ DestFile = GetFinalFilename();
// set Item to complete as the remaining work is all local (verify etc)
Complete = true;
// set Item to complete as the remaining work is all local (verify etc)
Complete = true;
-bool pkgAcqMetaBase::VerifyVendor(string Message, const string &RealURI)/*{{{*/
+bool pkgAcqMetaBase::VerifyVendor(string Message) /*{{{*/
pkgAcquire::Item::Failed(Message, Cnf);
Status = StatDone;
pkgAcquire::Item::Failed(Message, Cnf);
Status = StatDone;
- string FinalFile = _config->FindDir("Dir::State::lists") + URItoFileName(RealURI);
-
_error->Warning(_("The repository '%s' does not have a Release file. "
"This is deprecated, please contact the owner of the "
"repository."), URIDesc.c_str());
_error->Warning(_("The repository '%s' does not have a Release file. "
"This is deprecated, please contact the owner of the "
"repository."), URIDesc.c_str());
{
// Done, queue for rename on transaction finished
if (FileExists(DestFile))
{
// Done, queue for rename on transaction finished
if (FileExists(DestFile))
- TransactionManager->TransactionStageCopy(this, DestFile, FinalFile);
+ TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename());
// queue without any kind of hashsum support
QueueIndexes(false);
// queue without any kind of hashsum support
QueueIndexes(false);
}
/*}}}*/
// pkgAcqMetaClearSig::Custom600Headers - Insert custom request headers /*{{{*/
}
/*}}}*/
// pkgAcqMetaClearSig::Custom600Headers - Insert custom request headers /*{{{*/
-// ---------------------------------------------------------------------
#if APT_PKG_ABI >= 413
string pkgAcqMetaClearSig::Custom600Headers() const
#else
string pkgAcqMetaClearSig::Custom600Headers()
#endif
{
#if APT_PKG_ABI >= 413
string pkgAcqMetaClearSig::Custom600Headers() const
#else
string pkgAcqMetaClearSig::Custom600Headers()
#endif
{
- string Header = GetCustom600Headers(RealURI);
+ string Header = pkgAcqMetaBase::Custom600Headers();
Header += "\nFail-Ignore: true";
return Header;
}
/*}}}*/
Header += "\nFail-Ignore: true";
return Header;
}
/*}}}*/
-// pkgAcqMetaClearSig::Done - We got a file /*{{{*/
+// pkgAcqMetaClearSig::Done - We got a file /*{{{*/
// ---------------------------------------------------------------------
void pkgAcqMetaClearSig::Done(std::string Message,unsigned long long Size,
HashStringList const &Hashes,
// ---------------------------------------------------------------------
void pkgAcqMetaClearSig::Done(std::string Message,unsigned long long Size,
HashStringList const &Hashes,
- if(CheckDownloadDone(Message, RealURI) == true)
+ if(CheckDownloadDone(Message) == true)
QueueForSignatureVerify(DestFile, DestFile);
return;
}
QueueForSignatureVerify(DestFile, DestFile);
return;
}
- else
- {
- if(CheckAuthDone(Message, RealURI) == true)
- {
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
-
- // queue for copy in place
- TransactionManager->TransactionStageCopy(this, DestFile, FinalFile);
- }
- }
+ else if(CheckAuthDone(Message) == true)
+ TransactionManager->TransactionStageCopy(this, DestFile, GetFinalFilename());
}
/*}}}*/
void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
}
/*}}}*/
void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
// Queue the 'old' InRelease file for removal if we try Release.gpg
// as otherwise the file will stay around and gives a false-auth
// impression (CVE-2012-0214)
// Queue the 'old' InRelease file for removal if we try Release.gpg
// as otherwise the file will stay around and gives a false-auth
// impression (CVE-2012-0214)
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile.append(URItoFileName(RealURI));
- TransactionManager->TransactionStageRemoval(this, FinalFile);
+ TransactionManager->TransactionStageRemoval(this, GetFinalFilename());
Status = StatDone;
new pkgAcqMetaIndex(Owner, TransactionManager,
Status = StatDone;
new pkgAcqMetaIndex(Owner, TransactionManager,
- if(CheckStopAuthentication(RealURI, Message))
+ if(CheckStopAuthentication(Message))
return;
_error->Warning(_("The data from '%s' is not signed. Packages "
return;
_error->Warning(_("The data from '%s' is not signed. Packages "
* that PackageFile objects are correctly filled in */
if (FileExists(DestFile))
{
* that PackageFile objects are correctly filled in */
if (FileExists(DestFile))
{
- string FinalFile = _config->FindDir("Dir::State::lists");
- FinalFile += URItoFileName(RealURI);
+ string FinalFile = GetFinalFilename();
/* InRelease files become Release files, otherwise
* they would be considered as trusted later on */
RealURI = RealURI.replace(RealURI.rfind("InRelease"), 9,
/* InRelease files become Release files, otherwise
* they would be considered as trusted later on */
RealURI = RealURI.replace(RealURI.rfind("InRelease"), 9,
}
// Done, move it into position
}
// Done, move it into position
- string FinalFile = _config->FindDir("Dir::Cache::Archives");
- FinalFile += flNotDir(StoreFilename);
+ string const FinalFile = GetFinalFilename();
Rename(DestFile,FinalFile);
StoreFilename = DestFile = FinalFile;
Complete = true;
}
/*}}}*/
Rename(DestFile,FinalFile);
StoreFilename = DestFile = FinalFile;
Complete = true;
}
/*}}}*/
+// Acquire::Item::GetFinalFilename - Return the full final file path /*{{{*/
+std::string pkgAcqArchive::GetFinalFilename() const
+{
+ return _config->FindDir("Dir::Cache::Archives") + flNotDir(StoreFilename);
+}
+ /*}}}*/
// AcqArchive::Failed - Failure handler /*{{{*/
// ---------------------------------------------------------------------
/* Here we try other sources */
// AcqArchive::Failed - Failure handler /*{{{*/
// ---------------------------------------------------------------------
/* Here we try other sources */
*/
bool Rename(std::string From,std::string To);
*/
bool Rename(std::string From,std::string To);
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const;
+
public:
/** \brief The current status of this item. */
public:
/** \brief The current status of this item. */
bool AuthPass;
// required to deal gracefully with problems caused by incorrect ims hits
bool AuthPass;
// required to deal gracefully with problems caused by incorrect ims hits
+ bool IMSHit;
+
+ /** \brief The URI of the signature file. Unlike Desc.URI, this is
+ * never modified; it is used to determine the file that is being
+ * downloaded.
+ */
+ std::string RealURI;
/** \brief Starts downloading the individual index files.
*
/** \brief Starts downloading the individual index files.
*
* \param Message The message block received from the fetch
* subprocess.
*/
* \param Message The message block received from the fetch
* subprocess.
*/
- bool CheckDownloadDone(const std::string &Message,
- const std::string &RealURI);
+ bool CheckDownloadDone(const std::string &Message);
/** \brief Queue the downloaded Signature for verification */
void QueueForSignatureVerify(const std::string &MetaIndexFile,
const std::string &MetaIndexFileSignature);
/** \brief Queue the downloaded Signature for verification */
void QueueForSignatureVerify(const std::string &MetaIndexFile,
const std::string &MetaIndexFileSignature);
- /** \brief get the custom600 header for all pkgAcqMeta */
- std::string GetCustom600Headers(const std::string &RealURI) const;
+#if APT_PKG_ABI >= 413
+ virtual std::string Custom600Headers() const;
+#else
+ virtual std::string Custom600Headers();
+#endif
/** \brief Called when authentication succeeded.
*
/** \brief Called when authentication succeeded.
*
* \param Message The message block received from the fetch
* subprocess.
*/
* \param Message The message block received from the fetch
* subprocess.
*/
- bool CheckAuthDone(std::string Message, const std::string &RealURI);
+ bool CheckAuthDone(std::string Message);
/** Check if the current item should fail at this point */
/** Check if the current item should fail at this point */
- bool CheckStopAuthentication(const std::string &RealURI,
- const std::string &Message);
+ bool CheckStopAuthentication(const std::string &Message);
/** \brief Check that the release file is a release file for the
* correct distribution.
*
* \return \b true if no fatal errors were encountered.
*/
/** \brief Check that the release file is a release file for the
* correct distribution.
*
* \return \b true if no fatal errors were encountered.
*/
- bool VerifyVendor(std::string Message, const std::string &RealURI);
-
+ bool VerifyVendor(std::string Message);
+
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const;
+
+ virtual std::string DescURI() {return RealURI; };
+
// transaction code
void Add(Item *I);
void AbortTransaction();
// transaction code
void Add(Item *I);
void AbortTransaction();
pkgAcqMetaBase(pkgAcquire *Owner,
const std::vector<IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser,
pkgAcqMetaBase(pkgAcquire *Owner,
const std::vector<IndexTarget*>* IndexTargets,
indexRecords* MetaIndexParser,
+ std::string const &RealURI,
HashStringList const &ExpectedHashes=HashStringList(),
pkgAcqMetaBase *TransactionManager=NULL)
: Item(Owner, ExpectedHashes, TransactionManager),
MetaIndexParser(MetaIndexParser), IndexTargets(IndexTargets),
HashStringList const &ExpectedHashes=HashStringList(),
pkgAcqMetaBase *TransactionManager=NULL)
: Item(Owner, ExpectedHashes, TransactionManager),
MetaIndexParser(MetaIndexParser), IndexTargets(IndexTargets),
- AuthPass(false), IMSHit(false) {};
+ AuthPass(false), IMSHit(false), RealURI(RealURI) {};
};
/*}}}*/
/** \brief An acquire item that downloads the detached signature {{{
};
/*}}}*/
/** \brief An acquire item that downloads the detached signature {{{
- /** \brief The URI of the signature file. Unlike Desc.URI, this is
- * never modified; it is used to determine the file that is being
- * downloaded.
- */
- std::string RealURI;
-
/** \brief The file we need to verify */
std::string MetaIndexFile;
/** \brief The file we need to verify */
std::string MetaIndexFile;
std::string ShortDesc;
public:
std::string ShortDesc;
public:
// Specialized action members
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size,
HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
// Specialized action members
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size,
HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
-#if APT_PKG_ABI >= 413
- virtual std::string Custom600Headers() const;
-#else
- virtual std::string Custom600Headers();
-#endif
- virtual std::string DescURI() {return RealURI; };
/** \brief Create a new pkgAcqMetaSig. */
pkgAcqMetaSig(pkgAcquire *Owner,
/** \brief Create a new pkgAcqMetaSig. */
pkgAcqMetaSig(pkgAcquire *Owner,
- /** \brief The URI that is actually being downloaded; never
- * modified by pkgAcqMetaIndex.
- */
- std::string RealURI;
-
std::string URIDesc;
std::string ShortDesc;
std::string URIDesc;
std::string ShortDesc;
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
-#if APT_PKG_ABI >= 413
- virtual std::string Custom600Headers() const;
-#else
- virtual std::string Custom600Headers();
-#endif
- virtual std::string DescURI() {return RealURI; };
virtual void Finished();
/** \brief Create a new pkgAcqMetaIndex. */
virtual void Finished();
/** \brief Create a new pkgAcqMetaIndex. */
bool VerifyHashByMetaKey(HashStringList const &Hashes);
bool VerifyHashByMetaKey(HashStringList const &Hashes);
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const;
+
pkgAcqBaseIndex(pkgAcquire *Owner,
pkgAcqMetaBase *TransactionManager,
struct IndexTarget const * const Target,
pkgAcqBaseIndex(pkgAcquire *Owner,
pkgAcqMetaBase *TransactionManager,
struct IndexTarget const * const Target,
*/
bool PackagesFileReadyInPartial;
*/
bool PackagesFileReadyInPartial;
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const;
+
public:
// Specialized action members
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
public:
// Specialized action members
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
/** \brief Auto select the right compression to use */
void AutoSelectCompression();
/** \brief Auto select the right compression to use */
void AutoSelectCompression();
- /** \brief Get the full pathname of the final file for the current URI
- */
- std::string GetFinalFilename() const;
-
/** \brief Schedule file for verification after a IMS hit */
void ReverifyAfterIMS();
/** \brief Validate the downloaded index file */
bool ValidateFile(const std::string &FileName);
/** \brief Schedule file for verification after a IMS hit */
void ReverifyAfterIMS();
/** \brief Validate the downloaded index file */
bool ValidateFile(const std::string &FileName);
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const;
+
public:
// Specialized action members
public:
// Specialized action members
/** \brief Queue up the next available file for this version. */
bool QueueNext();
/** \brief Queue up the next available file for this version. */
bool QueueNext();
+
+ /** \brief Get the full pathname of the final file for the current URI */
+ virtual std::string GetFinalFilename() const;
+
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);
virtual void Failed(std::string Message,pkgAcquire::MethodConfig *Cnf);
virtual void Done(std::string Message,unsigned long long Size, HashStringList const &Hashes,
pkgAcquire::MethodConfig *Cnf);