From 457bea86ba07fc0cfcb08bcf9f81f5858975f916 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Fri, 1 Jul 2011 14:10:28 +0100 Subject: apt-pkg/acquire-item.cc: improve error message for valid-until --- apt-pkg/acquire-item.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/acquire-item.cc b/apt-pkg/acquire-item.cc index c3817f6ee..215615bdd 100644 --- a/apt-pkg/acquire-item.cc +++ b/apt-pkg/acquire-item.cc @@ -1473,8 +1473,10 @@ bool pkgAcqMetaIndex::VerifyVendor(string Message) /*{{{*/ // TRANSLATOR: The first %s is the URL of the bad Release file, the second is // the time since then the file is invalid - formated in the same way as in // the download progress display (e.g. 7d 3h 42min 1s) - return _error->Error(_("Release file expired, ignoring %s (invalid since %s)"), - RealURI.c_str(), TimeToStr(invalid_since).c_str()); + return _error->Error( + _("Release file for %s is expired (invalid since %s). " + "Updates for this repository will not be applied."), + RealURI.c_str(), TimeToStr(invalid_since).c_str()); } if (_config->FindB("Debug::pkgAcquire::Auth", false)) -- cgit v1.2.3 From 15fb00074cb5757e4cdcd790fcf75f0134ae0fe4 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 13 Jul 2011 13:47:25 +0200 Subject: apt-pkg/aptconfiguration.h: fix copy/paste error in getCompressionTypes() description --- apt-pkg/aptconfiguration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/aptconfiguration.h b/apt-pkg/aptconfiguration.h index 815db6cae..1f0399dd2 100644 --- a/apt-pkg/aptconfiguration.h +++ b/apt-pkg/aptconfiguration.h @@ -36,7 +36,7 @@ public: /*{{{*/ * \param Cached saves the result so we need to calculated it only once * this parameter should ony be used for testing purposes. * - * \return a vector of (all) Language Codes in the prefered usage order + * \return a vector of the compression types in the prefered usage order */ std::vector static const getCompressionTypes(bool const &Cached = true); -- cgit v1.2.3 From 89c4c588b275d098af33f36eeddea6fd75068342 Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Wed, 13 Jul 2011 19:02:10 +0200 Subject: fix from David Kalnischkies for the InRelease gpg verification code (LP: #784473) --- apt-pkg/indexcopy.cc | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'apt-pkg') diff --git a/apt-pkg/indexcopy.cc b/apt-pkg/indexcopy.cc index 064fb007c..31c577705 100644 --- a/apt-pkg/indexcopy.cc +++ b/apt-pkg/indexcopy.cc @@ -664,6 +664,21 @@ bool SigVerify::CopyAndVerify(string CDROM,string Name,vector &SigList, bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, int const &statusfd, int fd[2]) { + if (File == FileGPG) + { + #define SIGMSG "-----BEGIN PGP SIGNED MESSAGE-----\n" + char buffer[sizeof(SIGMSG)]; + FILE* gpg = fopen(File.c_str(), "r"); + if (gpg == NULL) + return _error->Errno("RunGPGV", _("Could not open file %s"), File.c_str()); + char const * const test = fgets(buffer, sizeof(buffer), gpg); + fclose(gpg); + if (test == NULL || strcmp(buffer, SIGMSG) != 0) + return _error->Error(_("File %s doesn't start with a clearsigned message"), File.c_str()); + #undef SIGMSG + } + + string const gpgvpath = _config->Find("Dir::Bin::gpg", "/usr/bin/gpgv"); // FIXME: remove support for deprecated APT::GPGV setting string const trustedFile = _config->Find("APT::GPGV::TrustedKeyring", _config->FindFile("Dir::Etc::Trusted")); @@ -688,7 +703,11 @@ bool SigVerify::RunGPGV(std::string const &File, std::string const &FileGPG, Args.reserve(30); if (keyrings.empty() == true) - return false; + { + // TRANSLATOR: %s is the trusted keyring parts directory + return _error->Error(_("No keyring installed in %s."), + _config->FindDir("Dir::Etc::TrustedParts").c_str()); + } Args.push_back(gpgvpath.c_str()); Args.push_back("--ignore-time-conflict"); -- cgit v1.2.3 From 953b348cb02fcdccb597b6988f904bfdb696e92e Mon Sep 17 00:00:00 2001 From: Michael Vogt Date: Thu, 14 Jul 2011 11:03:55 +0200 Subject: make ResolveByKeep() more clever and hold back packages that would go into a broken policy state by the upgrade --- apt-pkg/algorithms.cc | 40 ++++++++++++++++++++++++++++++++++------ apt-pkg/algorithms.h | 3 +++ 2 files changed, 37 insertions(+), 6 deletions(-) (limited to 'apt-pkg') diff --git a/apt-pkg/algorithms.cc b/apt-pkg/algorithms.cc index 2dae4258a..7c911b865 100644 --- a/apt-pkg/algorithms.cc +++ b/apt-pkg/algorithms.cc @@ -1176,6 +1176,31 @@ bool pkgProblemResolver::Resolve(bool BrokenFix) return true; } /*}}}*/ + +// ProblemResolver::BreaksInstOrPolicy - Check if the given pkg is broken/*{{{*/ +// --------------------------------------------------------------------- +/* This checks if the given package is broken either by a hard dependency + (InstBroken()) or by introducing a new policy breakage e.g. new + unsatisfied recommends for a package that was in "policy-good" state + + Note that this is not perfect as it will ignore further breakage + for already broken policy (recommends) +*/ +bool pkgProblemResolver::InstOrNewPolicyBroken(pkgCache::PkgIterator I) +{ + + // a broken install is always a problem + if (Cache[I].InstBroken() == true) + return true; + + // a newly broken policy (recommends/suggests) is a problem + if (Cache[I].NowPolicyBroken() == false && + Cache[I].InstPolicyBroken() == true) + return true; + + return false; +} + // ProblemResolver::ResolveByKeep - Resolve problems using keep /*{{{*/ // --------------------------------------------------------------------- /* This is the work horse of the soft upgrade routine. It is very gental @@ -1220,9 +1245,12 @@ bool pkgProblemResolver::ResolveByKeep() { pkgCache::PkgIterator I(Cache,*K); - if (Cache[I].InstallVer == 0 || Cache[I].InstBroken() == false) + if (Cache[I].InstallVer == 0) continue; + if (InstOrNewPolicyBroken(I) == false) + continue; + /* Keep the package. If this works then great, otherwise we have to be significantly more agressive and manipulate its dependencies */ if ((Flags[I->ID] & Protected) == 0) @@ -1230,7 +1258,7 @@ bool pkgProblemResolver::ResolveByKeep() if (Debug == true) clog << "Keeping package " << I.FullName(false) << endl; Cache.MarkKeep(I, false, false); - if (Cache[I].InstBroken() == false) + if (InstOrNewPolicyBroken(I) == false) { K = PList - 1; continue; @@ -1280,11 +1308,11 @@ bool pkgProblemResolver::ResolveByKeep() Cache.MarkKeep(Pkg, false, false); } - if (Cache[I].InstBroken() == false) + if (InstOrNewPolicyBroken(I) == false) break; } - if (Cache[I].InstBroken() == false) + if (InstOrNewPolicyBroken(I) == false) break; if (Start == End) @@ -1292,11 +1320,11 @@ bool pkgProblemResolver::ResolveByKeep() Start++; } - if (Cache[I].InstBroken() == false) + if (InstOrNewPolicyBroken(I) == false) break; } - if (Cache[I].InstBroken() == true) + if (InstOrNewPolicyBroken(I) == true) continue; // Restart again. diff --git a/apt-pkg/algorithms.h b/apt-pkg/algorithms.h index ebe31cc10..99501bed1 100644 --- a/apt-pkg/algorithms.h +++ b/apt-pkg/algorithms.h @@ -106,6 +106,9 @@ class pkgProblemResolver /*{{{*/ void MakeScores(); bool DoUpgrade(pkgCache::PkgIterator Pkg); + protected: + bool InstOrNewPolicyBroken(pkgCache::PkgIterator Pkg); + public: inline void Protect(pkgCache::PkgIterator Pkg) {Flags[Pkg->ID] |= Protected; Cache.MarkProtected(Pkg);}; -- cgit v1.2.3