From 7ea7ac9efa88b73fc6ff30483a928ef49b95c015 Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Fri, 8 Apr 2011 13:57:04 +0200 Subject: * apt-pkg/acquire-item.cc: - Use Release files even if they cannot be verified (LP: #704595) --- apt-pkg/acquire-item.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 39b9feff2..1d651ba69 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1502,6 +1502,26 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) ReportMirrorFailure("GPGFailure"); } + /* Always move the meta index, even if gpgv failed. This ensures + * that PackageFile objects are correctly filled in */ + { + string FinalFile = _config->FindDir("Dir::State::lists"); + FinalFile += URItoFileName(RealURI); + /* InRelease files become Release files, otherwise + * they would be considered as trusted later on */ + if (SigFile == DestFile) { + RealURI = RealURI.replace(RealURI.rfind("InRelease"), 9, + "Release"); + FinalFile = FinalFile.replace(FinalFile.rfind("InRelease"), 9, + "Release"); + SigFile = FinalFile; + } + Rename(DestFile,FinalFile); + chmod(FinalFile.c_str(),0644); + + DestFile = FinalFile; + } + // No Release file was present, or verification failed, so fall // back to queueing Packages files without verification QueueIndexes(false); -- cgit v1.2.3 From a235ddf86a9cc5c3a8fade9084044229ff51a77f Mon Sep 17 00:00:00 2001 From: Julian Andres Klode Date: Sat, 16 Apr 2011 11:02:47 +0200 Subject: apt-pkg/acquire-item.cc: Only try to rename existing Release files (Closes: #622912) --- apt-pkg/acquire-item.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg/acquire-item.cc') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index 1d651ba69..7b120d3ce 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1504,7 +1504,7 @@ void pkgAcqMetaIndex::Failed(string Message,pkgAcquire::MethodConfig *Cnf) /* Always move the meta index, even if gpgv failed. This ensures * that PackageFile objects are correctly filled in */ - { + if (FileExists(DestFile)) { string FinalFile = _config->FindDir("Dir::State::lists"); FinalFile += URItoFileName(RealURI); /* InRelease files become Release files, otherwise -- cgit v1.2.3