+
+ // Essential packages get special treatment
+ bool IsEssential = false;
+ if ((Pkg->Flags & pkgCache::Flag::Essential) != 0)
+ IsEssential = true;
+
+ /* Check for packages that are the dependents of essential packages and
+ promote them too */
+ if (Pkg->CurrentVer != 0)
+ {
+ for (DepIterator D = Pkg.RevDependsList(); D.end() == false &&
+ IsEssential == false; D++)
+ if (D->Type == pkgCache::Dep::Depends || D->Type == pkgCache::Dep::PreDepends)
+ if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0)
+ IsEssential = true;
+ }
+
+ if (IsEssential == true)
+ {
+ if (_config->FindB("APT::Force-LoopBreak",false) == false)
+ return _error->Error(_("This installation run will require temporarily "
+ "removing the essential package %s due to a "
+ "Conflicts/Pre-Depends loop. This is often bad, "
+ "but if you really want to do it, activate the "
+ "APT::Force-LoopBreak option."),Pkg.Name());
+ }