|
@@ -1077,6 +1077,8 @@ void pkgAcqMetaIndex::Done(string Message,unsigned long Size,string Hash, /*{{{*
|
|
|
{
|
|
{
|
|
|
string FinalFile = _config->FindDir("Dir::State::lists");
|
|
string FinalFile = _config->FindDir("Dir::State::lists");
|
|
|
FinalFile += URItoFileName(RealURI);
|
|
FinalFile += URItoFileName(RealURI);
|
|
|
|
|
+ if (SigFile == DestFile)
|
|
|
|
|
+ SigFile = FinalFile;
|
|
|
Rename(DestFile,FinalFile);
|
|
Rename(DestFile,FinalFile);
|
|
|
chmod(FinalFile.c_str(),0644);
|
|
chmod(FinalFile.c_str(),0644);
|
|
|
DestFile = FinalFile;
|
|
DestFile = FinalFile;
|
|
@@ -1110,6 +1112,8 @@ void pkgAcqMetaIndex::RetrievalDone(string Message) /*{{{*/
|
|
|
{
|
|
{
|
|
|
string FinalFile = _config->FindDir("Dir::State::lists");
|
|
string FinalFile = _config->FindDir("Dir::State::lists");
|
|
|
FinalFile += URItoFileName(RealURI);
|
|
FinalFile += URItoFileName(RealURI);
|
|
|
|
|
+ if (SigFile == DestFile)
|
|
|
|
|
+ SigFile = FinalFile;
|
|
|
DestFile = FinalFile;
|
|
DestFile = FinalFile;
|
|
|
}
|
|
}
|
|
|
Complete = true;
|
|
Complete = true;
|
|
@@ -1141,6 +1145,10 @@ void pkgAcqMetaIndex::AuthDone(string Message) /*{{{*/
|
|
|
// Download further indexes with verification
|
|
// Download further indexes with verification
|
|
|
QueueIndexes(true);
|
|
QueueIndexes(true);
|
|
|
|
|
|
|
|
|
|
+ // is it a clearsigned MetaIndex file?
|
|
|
|
|
+ if (DestFile == SigFile)
|
|
|
|
|
+ return;
|
|
|
|
|
+
|
|
|
// Done, move signature file into position
|
|
// Done, move signature file into position
|
|
|
string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
|
|
string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
|
|
|
URItoFileName(RealURI) + ".gpg";
|
|
URItoFileName(RealURI) + ".gpg";
|
|
@@ -1300,13 +1308,20 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
|
|
|
if (AuthPass == true)
|
|
if (AuthPass == true)
|
|
|
{
|
|
{
|
|
|
// gpgv method failed, if we have a good signature
|
|
// gpgv method failed, if we have a good signature
|
|
|
- string LastGoodSigFile = _config->FindDir("Dir::State::lists") +
|
|
|
|
|
- "partial/" + URItoFileName(RealURI) + ".gpg.reverify";
|
|
|
|
|
|
|
+ string LastGoodSigFile = _config->FindDir("Dir::State::lists");
|
|
|
|
|
+ if (DestFile == SigFile)
|
|
|
|
|
+ LastGoodSigFile.append(URItoFileName(RealURI));
|
|
|
|
|
+ else
|
|
|
|
|
+ LastGoodSigFile.append("partial/").append(URItoFileName(RealURI)).append(".gpg.reverify");
|
|
|
|
|
+
|
|
|
if(FileExists(LastGoodSigFile))
|
|
if(FileExists(LastGoodSigFile))
|
|
|
{
|
|
{
|
|
|
- string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
|
|
|
|
|
- URItoFileName(RealURI) + ".gpg";
|
|
|
|
|
- Rename(LastGoodSigFile,VerifiedSigFile);
|
|
|
|
|
|
|
+ if (DestFile != SigFile)
|
|
|
|
|
+ {
|
|
|
|
|
+ string VerifiedSigFile = _config->FindDir("Dir::State::lists") +
|
|
|
|
|
+ URItoFileName(RealURI) + ".gpg";
|
|
|
|
|
+ Rename(LastGoodSigFile,VerifiedSigFile);
|
|
|
|
|
+ }
|
|
|
Status = StatTransientNetworkError;
|
|
Status = StatTransientNetworkError;
|
|
|
_error->Warning(_("A error occurred during the signature "
|
|
_error->Warning(_("A error occurred during the signature "
|
|
|
"verification. The repository is not updated "
|
|
"verification. The repository is not updated "
|
|
@@ -1330,6 +1345,35 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf)
|
|
|
QueueIndexes(false);
|
|
QueueIndexes(false);
|
|
|
}
|
|
}
|
|
|
/*}}}*/
|
|
/*}}}*/
|
|
|
|
|
+pkgAcqMetaClearSig::pkgAcqMetaClearSig(pkgAcquire *Owner, /*{{{*/
|
|
|
|
|
+ string const &URI, string const &URIDesc, string const &ShortDesc,
|
|
|
|
|
+ string const &MetaIndexURI, string const &MetaIndexURIDesc, string const &MetaIndexShortDesc,
|
|
|
|
|
+ string const &MetaSigURI, string const &MetaSigURIDesc, string const &MetaSigShortDesc,
|
|
|
|
|
+ const vector<struct IndexTarget*>* IndexTargets,
|
|
|
|
|
+ indexRecords* MetaIndexParser) :
|
|
|
|
|
+ pkgAcqMetaIndex(Owner, URI, URIDesc, ShortDesc, "", IndexTargets, MetaIndexParser),
|
|
|
|
|
+ MetaIndexURI(MetaIndexURI), MetaIndexURIDesc(MetaIndexURIDesc), MetaIndexShortDesc(MetaIndexShortDesc),
|
|
|
|
|
+ MetaSigURI(MetaSigURI), MetaSigURIDesc(MetaSigURIDesc), MetaSigShortDesc(MetaSigShortDesc)
|
|
|
|
|
+{
|
|
|
|
|
+ SigFile = DestFile;
|
|
|
|
|
+}
|
|
|
|
|
+ /*}}}*/
|
|
|
|
|
+void pkgAcqMetaClearSig::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /*{{{*/
|
|
|
|
|
+{
|
|
|
|
|
+ if (AuthPass == false)
|
|
|
|
|
+ {
|
|
|
|
|
+ new pkgAcqMetaSig(Owner,
|
|
|
|
|
+ MetaSigURI, MetaSigURIDesc, MetaSigShortDesc,
|
|
|
|
|
+ MetaIndexURI, MetaIndexURIDesc, MetaIndexShortDesc,
|
|
|
|
|
+ IndexTargets, MetaIndexParser);
|
|
|
|
|
+ if (Cnf->LocalOnly == true ||
|
|
|
|
|
+ StringToBool(LookupTag(Message, "Transient-Failure"), false) == false)
|
|
|
|
|
+ Dequeue();
|
|
|
|
|
+ }
|
|
|
|
|
+ else
|
|
|
|
|
+ pkgAcqMetaIndex::Failed(Message, Cnf);
|
|
|
|
|
+}
|
|
|
|
|
+ /*}}}*/
|
|
|
// AcqArchive::AcqArchive - Constructor /*{{{*/
|
|
// AcqArchive::AcqArchive - Constructor /*{{{*/
|
|
|
// ---------------------------------------------------------------------
|
|
// ---------------------------------------------------------------------
|
|
|
/* This just sets up the initial fetch environment and queues the first
|
|
/* This just sets up the initial fetch environment and queues the first
|