summaryrefslogtreecommitdiff
path: root/apt-pkg/packagemanager.cc
diff options
context:
space:
mode:
authorDavid Kalnischkies <kalnischkies@gmail.com>2013-06-24 12:29:48 +0200
committerDavid Kalnischkies <kalnischkies@gmail.com>2013-06-24 12:29:48 +0200
commit6420c00e30cd9512e045a5370bf391321691ca78 (patch)
treeac23cf07560a3f8fb10933ce037c6cb988b85691 /apt-pkg/packagemanager.cc
parent947da3eb4ecaf6b7d64bbcfb656efeff33cff58b (diff)
do not modify DepIterator as we might check again
fixup for 42d51f333e8ef522fed02cdfc48663488d56c3a3 The for-loop iterating over the DepIterators which need configuration can (and will be in 'complicated' situations) run multiple times, so we can't just GlobOr on the DepIterator as it modifies it, so that the next iteration over the list ends up checking another dependency leading us into a 'Internal error, packages left unconfigured. foopkg' maybe or we are 'lucky' and calculate a solution which might break down the line Git-Dch: Ignore
Diffstat (limited to 'apt-pkg/packagemanager.cc')
-rw-r--r--apt-pkg/packagemanager.cc12
1 files changed, 7 insertions, 5 deletions
diff --git a/apt-pkg/packagemanager.cc b/apt-pkg/packagemanager.cc
index b8932753d..310934c42 100644
--- a/apt-pkg/packagemanager.cc
+++ b/apt-pkg/packagemanager.cc
@@ -420,11 +420,14 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth)
do
{
Changed = false;
- for (std::list<DepIterator>::iterator D = needConfigure.begin(); D != needConfigure.end(); ++D)
+ for (std::list<DepIterator>::const_iterator D = needConfigure.begin(); D != needConfigure.end(); ++D)
{
- // Compute a single dependency element (glob or)
+ // Compute a single dependency element (glob or) without modifying D
pkgCache::DepIterator Start, End;
- D->GlobOr(Start,End);
+ {
+ pkgCache::DepIterator Discard = *D;
+ Discard.GlobOr(Start,End);
+ }
if (End->Type != pkgCache::Dep::Depends)
continue;
@@ -483,9 +486,8 @@ bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth)
}
-
if (Bad == true && Changed == false && Debug == true)
- std::clog << OutputInDepth(Depth) << "Could not satisfy " << Start << std::endl;
+ std::clog << OutputInDepth(Depth) << "Could not satisfy " << *D << std::endl;
}
if (i++ > max_loops)
return _error->Error("Internal error: MaxLoopCount reached in SmartUnPack (2) for %s, aborting", Pkg.FullName().c_str());