diff options
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/cdrom.cc | 4 | ||||
-rw-r--r-- | apt-pkg/indexcopy.cc | 26 |
2 files changed, 23 insertions, 7 deletions
diff --git a/apt-pkg/cdrom.cc b/apt-pkg/cdrom.cc index f5c19a4d6..d9ecdf4f6 100644 --- a/apt-pkg/cdrom.cc +++ b/apt-pkg/cdrom.cc @@ -68,12 +68,11 @@ bool pkgCdrom::FindPackages(string CD, if (RealFileExists(".aptignr") == true) return true; - /* Check _first_ for a signature file as apt-cdrom assumes that all files under a Packages/Source file are in control of that file and stops the scanning */ - if (RealFileExists("Release.gpg") == true) + if (RealFileExists("Release.gpg") == true || RealFileExists("InRelease") == true) { SigList.push_back(CD); } @@ -718,6 +717,7 @@ bool pkgCdrom::Add(pkgCdromStatus *log) /*{{{*/ DropRepeats(List,"Packages"); DropRepeats(SourceList,"Sources"); DropRepeats(SigList,"Release.gpg"); + DropRepeats(SigList,"InRelease"); DropRepeats(TransList,""); if(log != NULL) { msg.str(""); diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index e38fe3e45..f6457aa39 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -638,13 +638,19 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList, string const releasegpg = *I+"Release.gpg"; string const release = *I+"Release"; + string const inrelease = *I+"InRelease"; + bool useInRelease = true; // a Release.gpg without a Release should never happen - if(RealFileExists(release) == false) + if (RealFileExists(inrelease) == true) + ; + else if(RealFileExists(release) == false || RealFileExists(releasegpg) == false) { delete MetaIndex; continue; } + else + useInRelease = false; pid_t pid = ExecFork(); if(pid < 0) { @@ -652,11 +658,16 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList, return false; } if(pid == 0) - RunGPGV(release, releasegpg); + { + if (useInRelease == true) + RunGPGV(inrelease, inrelease); + else + RunGPGV(release, releasegpg); + } if(!ExecWait(pid, "gpgv")) { _error->Warning("Signature verification failed for: %s", - releasegpg.c_str()); + (useInRelease ? inrelease.c_str() : releasegpg.c_str())); // something went wrong, don't copy the Release.gpg // FIXME: delete any existing gpg file? continue; @@ -686,8 +697,13 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector<string> &SigList, delete MetaIndex; // everything was fine, copy the Release and Release.gpg file - CopyMetaIndex(CDROM, Name, prefix, "Release"); - CopyMetaIndex(CDROM, Name, prefix, "Release.gpg"); + if (useInRelease == true) + CopyMetaIndex(CDROM, Name, prefix, "InRelease"); + else + { + CopyMetaIndex(CDROM, Name, prefix, "Release"); + CopyMetaIndex(CDROM, Name, prefix, "Release.gpg"); + } } return true; |