X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/a530607f8ac4936402831d854f171fc8dc89ef4f..ce857f32cf3c73ee67147ea0eafadb5a1c5da952:/apt-pkg/indexcopy.cc diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 9e5c03e0b..0142d7dbe 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -522,6 +522,15 @@ bool SigVerify::Verify(string prefix, string file, indexRecords *MetaIndex) { const indexRecords::checkSum *Record = MetaIndex->Lookup(file); + // we skip non-existing files in the verifcation to support a cdrom + // with no Packages file (just a Package.gz), see LP: #255545 + // (non-existing files are not considered a error) + if(!FileExists(prefix+file)) + { + _error->Warning("Skipping non-exisiting file %s", string(prefix+file).c_str()); + return true; + } + if (!Record) { _error->Warning("Can't find authentication record for: %s",file.c_str()); @@ -542,8 +551,8 @@ bool SigVerify::Verify(string prefix, string file, indexRecords *MetaIndex) return true; } - -bool SigVerify::CopyMetaIndex(string CDROM, string CDName, + /*}}}*/ +bool SigVerify::CopyMetaIndex(string CDROM, string CDName, /*{{{*/ string prefix, string file) { char S[400]; @@ -563,8 +572,8 @@ bool SigVerify::CopyMetaIndex(string CDROM, string CDName, return true; } - -bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, + /*}}}*/ +bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, /*{{{*/ vector PkgList,vector SrcList) { if (SigList.size() == 0) @@ -583,7 +592,10 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, // a Release.gpg without a Release should never happen if(!FileExists(*I+"Release")) + { + delete MetaIndex; continue; + } // verify the gpg signature of "Release" @@ -651,6 +663,7 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, if(!Verify(prefix,*I, MetaIndex)) { // something went wrong, don't copy the Release.gpg // FIXME: delete any existing gpg file? + _error->Discard(); continue; } } @@ -665,10 +678,9 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, return true; } - - -bool TranslationsCopy::CopyTranslations(string CDROM,string Name,vector &List, - pkgCdromStatus *log) + /*}}}*/ +bool TranslationsCopy::CopyTranslations(string CDROM,string Name, /*{{{*/ + vector &List, pkgCdromStatus *log) { OpProgress *Progress = NULL; if (List.size() == 0) @@ -840,3 +852,4 @@ bool TranslationsCopy::CopyTranslations(string CDROM,string Name,vector return true; } + /*}}}*/