summaryrefslogtreecommitdiff
path: root/apt-pkg/depcache.cc
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/depcache.cc')
-rw-r--r--apt-pkg/depcache.cc24
1 files changed, 12 insertions, 12 deletions
diff --git a/apt-pkg/depcache.cc b/apt-pkg/depcache.cc
index 786b20ec0..3ae5f5953 100644
--- a/apt-pkg/depcache.cc
+++ b/apt-pkg/depcache.cc
@@ -165,7 +165,7 @@ bool pkgDepCache::Init(OpProgress *Prog)
bool pkgDepCache::readStateFile(OpProgress *Prog) /*{{{*/
{
FileFd state_file;
- string const state = _config->FindDir("Dir::State") + "extended_states";
+ string const state = _config->FindFile("Dir::State::extended_states");
if(FileExists(state)) {
state_file.Open(state, FileFd::ReadOnly);
int const file_size = state_file.Size();
@@ -222,7 +222,7 @@ bool pkgDepCache::writeStateFile(OpProgress *prog, bool InstalledOnly) /*{{{*/
std::clog << "pkgDepCache::writeStateFile()" << std::endl;
FileFd StateFile;
- string const state = _config->FindDir("Dir::State") + "extended_states";
+ string const state = _config->FindFile("Dir::State::extended_states");
// if it does not exist, create a empty one
if(!FileExists(state))
@@ -875,7 +875,7 @@ void pkgDepCache::Update(OpProgress *Prog)
a bit we increase with a kill, but we should do something more clever… */
while(recheck.empty() == false)
for (std::set<unsigned long>::const_iterator p = recheck.begin();
- p != recheck.end(); ++p) {
+ p != recheck.end();) {
if (Prog != 0 && Done%20 == 0)
Prog->Progress(Done);
PkgIterator P = PkgIterator(*Cache, Cache->PkgP + *p);
@@ -883,7 +883,7 @@ void pkgDepCache::Update(OpProgress *Prog)
++killed;
++Done;
}
- recheck.erase(p);
+ recheck.erase(p++);
}
/* Okay, we have killed a great amount of pseudopackages -
@@ -918,7 +918,7 @@ void pkgDepCache::Update(OpProgress *Prog)
unsigned long const G = *g;
recheck.erase(g);
if (unlikely(ReInstallPseudoForGroup(G, recheck) == false))
- _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + *g).Name());
+ _error->Warning(_("Internal error, group '%s' has no installable pseudo package"), GrpIterator(*Cache, Cache->GrpP + G).Name());
}
}
@@ -1707,8 +1707,11 @@ bool pkgDepCache::MarkRequired(InRootSetFunc &userFunc)
{
if(!(PkgState[p->ID].Flags & Flag::Auto) ||
(p->Flags & Flag::Essential) ||
- userFunc.InRootSet(p))
-
+ userFunc.InRootSet(p) ||
+ // be nice even then a required package violates the policy (#583517)
+ // and do the full mark process also for required packages
+ (p.CurrentVer().end() != true &&
+ p.CurrentVer()->Priority == pkgCache::State::Required))
{
// the package is installed (and set to keep)
if(PkgState[p->ID].Keep() && !p.CurrentVer().end())
@@ -1785,10 +1788,6 @@ void pkgDepCache::MarkPackage(const pkgCache::PkgIterator &pkg,
// If the version belongs to a Multi-Arch all package
// we will mark all others in this Group with this version also
- // Beware: We compare versions here the lazy way: string comparision
- // this is bad if multiple repositories provide different versions
- // of the package with an identical version number - but even in this
- // case the dependencies are likely the same.
if (ver->MultiArch == pkgCache::Version::All &&
strcmp(ver.Arch(true), "all") == 0)
{
@@ -1800,7 +1799,8 @@ void pkgDepCache::MarkPackage(const pkgCache::PkgIterator &pkg,
for (VerIterator V = P.VersionList();
V.end() != true; ++V)
{
- if (strcmp(VerStr, V.VerStr()) != 0)
+ if (ver->Hash != V->Hash ||
+ strcmp(VerStr, V.VerStr()) != 0)
continue;
MarkPackage(P, V, follow_recommends, follow_suggests);
break;