only shown when debuging*/
bool pkgPackageManager::SmartConfigure(PkgIterator Pkg)
{
- if (Debug)
- clog << "SmartConfigure " << Pkg.Name() << endl;
-
+ if (Debug) {
+ VerIterator InstallVer = VerIterator(Cache,Cache[Pkg].InstallVer);
+ clog << "SmartConfigure " << Pkg.Name() << InstallVer.VerStr() << endl;
+ }
+
VerIterator const instVer = Cache[Pkg].InstVerIter(Cache);
/* Because of the ordered list, most dependancies should be unpacked,
if (!List->IsFlag(DepPkg,pkgOrderList::Loop)) {
List->Flag(Pkg,pkgOrderList::Loop);
// If SmartConfigure was succesfull, Bad is false, so break
- if (!(Bad = !SmartConfigure(DepPkg))) break;
+ Bad = !SmartConfigure(DepPkg);
+ List->RmFlag(Pkg,pkgOrderList::Loop);
+ if (!Bad) break;
}
} else if (List->IsFlag(DepPkg,pkgOrderList::Configured)) {
Bad = false;
/* If the dependany is still not satisfied, try, if possible, unpacking a package to satisfy it */
if (InstallVer != 0 && Bad) {
Bad = false;
- List->Flag(Pkg,pkgOrderList::Loop);
if (!List->IsFlag(DepPkg,pkgOrderList::Loop)) {
+ List->Flag(Pkg,pkgOrderList::Loop);
if (Debug)
cout << " Unpacking " << DepPkg.Name() << " to avoid loop" << endl;
SmartUnPack(DepPkg, true);
+ List->RmFlag(Pkg,pkgOrderList::Loop);
}
}
}
bool pkgPackageManager::SmartUnPack(PkgIterator Pkg, bool const Immediate)
{
- if (Debug)
- clog << "SmartUnPack " << Pkg.Name() << endl;
+ if (Debug) {
+ clog << "SmartUnPack " << Pkg.Name();
+ VerIterator InstallVer = VerIterator(Cache,Cache[Pkg].InstallVer);
+ if (Pkg.CurrentVer() == 0)
+ cout << "(install version " << InstallVer.VerStr() << ")" << endl;
+ else
+ cout << "(replace version " << Pkg.CurrentVer().VerStr() << " with " << InstallVer.VerStr() << ")" << endl;
+ }
// Check if it is already unpacked
if (Pkg.State() == pkgCache::PkgIterator::NeedsConfigure &&
// See if the current version is conflicting
if (ConflictPkg.CurrentVer() == Ver && List->IsNow(ConflictPkg))
- {
+ {
+ cout << Pkg.Name() << " conflicts with " << ConflictPkg.Name() << endl;
/* If a loop is not present or has not yet been detected, attempt to unpack packages
to resolve this conflict. If there is a loop present, remove packages to resolve this conflict */
if (!List->IsFlag(ConflictPkg,pkgOrderList::Loop)) {
if (Cache[ConflictPkg].Keep() == 0 && Cache[ConflictPkg].InstallVer != 0) {
if (Debug)
cout << "Unpacking " << ConflictPkg.Name() << " to prevent conflict" << endl;
- List->Flag(Pkg,pkgOrderList::Loop);
+ List->Flag(Pkg,pkgOrderList::Loop);
SmartUnPack(ConflictPkg,false);
+ // Remove loop to allow it to be used later if needed
+ List->RmFlag(Pkg,pkgOrderList::Loop);
} else {
if (EarlyRemove(ConflictPkg) == false)
return _error->Error("Internal Error, Could not early remove %s",ConflictPkg.Name());
cout << " Unpacking " << BrokenPkg.Name() << " to avoid break" << endl;
SmartUnPack(BrokenPkg, false);
+ List->RmFlag(Pkg,pkgOrderList::Loop);
}
// Check if a package needs to be removed
if (Cache[BrokenPkg].Delete() == true && !List->IsFlag(BrokenPkg,pkgOrderList::Configured)) {