continue;
// Mark the package and its dependends for immediate configuration
- if ((((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential ||
- (I->Flags & pkgCache::Flag::Important) == pkgCache::Flag::Important) &&
+ if ((((I->Flags & pkgCache::Flag::Essential) == pkgCache::Flag::Essential) &&
NoImmConfigure == false) || ImmConfigureAll)
{
if(Debug && !ImmConfigureAll)
continue;
// Ignore self conflicts, ignore conflicts from irrelevent versions
- if (D.ParentPkg() == Pkg || D.ParentVer() != D.ParentPkg().CurrentVer())
+ if (D.IsIgnorable(Pkg) || D.ParentVer() != D.ParentPkg().CurrentVer())
continue;
if (Cache.VS().CheckDep(Ver,D->CompareOp,D.TargetVer()) == false)
only shown when debuging*/
bool pkgPackageManager::SmartConfigure(PkgIterator Pkg, int const Depth)
{
- // If this is true, only check and correct and dependancies without the Loop flag
+ // If this is true, only check and correct and dependencies without the Loop flag
bool PkgLoop = List->IsFlag(Pkg,pkgOrderList::Loop);
if (Debug) {
VerIterator InstallVer = VerIterator(Cache,Cache[Pkg].InstallVer);
clog << OutputInDepth(Depth) << "SmartConfigure " << Pkg.Name() << " (" << InstallVer.VerStr() << ")";
if (PkgLoop)
- clog << " (Only Correct Dependancies)";
+ clog << " (Only Correct Dependencies)";
clog << endl;
}
VerIterator const instVer = Cache[Pkg].InstVerIter(Cache);
- /* Because of the ordered list, most dependancies should be unpacked,
+ /* Because of the ordered list, most dependencies should be unpacked,
however if there is a loop (A depends on B, B depends on A) this will not
- be the case, so check for dependancies before configuring. */
+ be the case, so check for dependencies before configuring. */
bool Bad = false;
for (DepIterator D = instVer.DependsList();
D.end() == false; )
/* If the dependany is still not satisfied, try, if possible, unpacking a package to satisfy it */
if (InstallVer != 0 && Bad) {
- Bad = false;
- if (List->IsNow(DepPkg) && !List->IsFlag(DepPkg,pkgOrderList::Loop)) {
- List->Flag(Pkg,pkgOrderList::Loop);
- if (Debug)
- cout << OutputInDepth(Depth) << "Unpacking " << DepPkg.Name() << " to avoid loop" << endl;
- SmartUnPack(DepPkg, true, Depth + 1);
- List->RmFlag(Pkg,pkgOrderList::Loop);
+ if (List->IsNow(DepPkg)) {
+ Bad = false;
+ if (List->IsFlag(Pkg,pkgOrderList::Loop))
+ {
+ if (Debug)
+ std::clog << OutputInDepth(Depth) << "Package " << Pkg << " loops in SmartConfigure" << std::endl;
+ }
+ else
+ {
+ List->Flag(Pkg,pkgOrderList::Loop);
+ if (Debug)
+ cout << OutputInDepth(Depth) << "Unpacking " << DepPkg.Name() << " to avoid loop" << endl;
+ SmartUnPack(DepPkg, true, Depth + 1);
+ List->RmFlag(Pkg,pkgOrderList::Loop);
+ }
}
}
if (Start==End) {
- if (Bad && Debug) {
- if (!List->IsFlag(DepPkg,pkgOrderList::Loop)) {
- _error->Warning("Could not satisfy dependancies for %s",Pkg.Name());
- }
- }
+ if (Bad && Debug && List->IsFlag(DepPkg,pkgOrderList::Loop) == false)
+ std::clog << OutputInDepth(Depth) << "Could not satisfy dependencies for " << Pkg.Name() << std::endl;
break;
} else {
Start++;
// Essential packages get special treatment
bool IsEssential = false;
- if ((Pkg->Flags & pkgCache::Flag::Essential) != 0)
+ if ((Pkg->Flags & pkgCache::Flag::Essential) != 0 ||
+ (Pkg->Flags & pkgCache::Flag::Important) != 0)
IsEssential = true;
/* Check for packages that are the dependents of essential packages and
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)
+ if ((D.ParentPkg()->Flags & pkgCache::Flag::Essential) != 0 ||
+ (D.ParentPkg()->Flags & pkgCache::Flag::Important) != 0)
IsEssential = true;
}
List->Flag(Pkg,pkgOrderList::Configured,pkgOrderList::States);
return Remove(Pkg,(Cache[Pkg].iFlags & pkgDepCache::Purge) == pkgDepCache::Purge);
- return true;
}
/*}}}*/
// PM::SmartUnPack - Install helper /*{{{*/
continue;
}
- if (Debug)
- clog << OutputInDepth(Depth) << "Trying to SmartConfigure " << Pkg.Name() << endl;
- Bad = !SmartConfigure(Pkg, Depth + 1);
- }
+ // check if it needs unpack or if if configure is enough
+ if (!List->IsFlag(Pkg,pkgOrderList::UnPacked))
+ {
+ if (Debug)
+ clog << OutputInDepth(Depth) << "Trying to SmartUnpack " << Pkg.Name() << endl;
+ // SmartUnpack with the ImmediateFlag to ensure its really ready
+ Bad = !SmartUnPack(Pkg, true, Depth + 1);
+ } else {
+ if (Debug)
+ clog << OutputInDepth(Depth) << "Trying to SmartConfigure " << Pkg.Name() << endl;
+ Bad = !SmartConfigure(Pkg, Depth + 1);
+ }
+ }
/* If this or element did not match then continue on to the
next or element until a matching element is found */
VerIterator Ver(Cache,*I);
PkgIterator BrokenPkg = Ver.ParentPkg();
VerIterator InstallVer(Cache,Cache[BrokenPkg].InstallVer);
-
+ if (BrokenPkg.CurrentVer() != Ver)
+ {
+ if (Debug)
+ std::clog << OutputInDepth(Depth) << " Ignore not-installed version " << Ver.VerStr() << " of " << Pkg.FullName() << " for " << End << std::endl;
+ continue;
+ }
+
// Check if it needs to be unpacked
if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false &&
List->IsNow(BrokenPkg)) {
List->Flag(Pkg,pkgOrderList::UnPacked,pkgOrderList::States);
- if (Immediate == true && instVer->MultiArch == pkgCache::Version::Same)
+ if (Immediate == true && (instVer->MultiArch & pkgCache::Version::Same) == pkgCache::Version::Same)
{
/* Do lockstep M-A:same unpacking in two phases:
First unpack all installed architectures, then the not installed.