summaryrefslogtreecommitdiff
path: root/apt-pkg
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2011-07-14 11:51:40 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2011-07-14 11:51:40 +0200
commit0dc01623882a8a51416e8635e76c941fc302abec (patch)
tree3d6c3bfb65618fc38473660c1f89e6fd294bd825 /apt-pkg
parentefd1da06d60b7ce4192fd3ca1fad55e018b7185e (diff)
parent118192bfd764d03af4cfcfc10eb9c38e7cc98721 (diff)
merged from the debian-sid branch
Diffstat (limited to 'apt-pkg')
-rw-r--r--apt-pkg/acquire-item.cc6
-rw-r--r--apt-pkg/algorithms.cc40
-rw-r--r--apt-pkg/algorithms.h3
-rw-r--r--apt-pkg/aptconfiguration.h2
4 files changed, 42 insertions, 9 deletions
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))
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);};
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<std::string> static const getCompressionTypes(bool const &Cached = true);