+ if (Debug && false)
+ cout << " " << Pkg.Name() << " conflicts with " << ConflictPkg.Name() << endl;
+
+ if (Debug && false) {
+ if (Ver==0) {
+ cout << " Checking if " << Ver << " of " << ConflictPkg.Name() << " satisfies this dependancy" << endl;
+ } else {
+ cout << " Checking if " << Ver.VerStr() << " of " << ConflictPkg.Name() << " satisfies this dependancy" << endl;
+ }
+
+ if (ConflictPkg.CurrentVer()==0) {
+ cout << " CurrentVer " << ConflictPkg.CurrentVer() << " IsNow " << List->IsNow(ConflictPkg) << " NeedsNothing " << (ConflictPkg.State() == PkgIterator::NeedsNothing) << endl;
+ } else {
+ cout << " CurrentVer " << ConflictPkg.CurrentVer().VerStr() << " IsNow " << List->IsNow(ConflictPkg) << " NeedsNothing " << (ConflictPkg.State() == PkgIterator::NeedsNothing) << endl;
+ }
+
+ if (InstallVer==0) {
+ cout << " InstallVer " << InstallVer << endl;
+ } else {
+ cout << " InstallVer " << InstallVer.VerStr() << endl;
+ }
+
+ cout << " Keep " << Cache[ConflictPkg].Keep() << " Unpacked " << List->IsFlag(ConflictPkg,pkgOrderList::UnPacked) << " Configured " << List->IsFlag(ConflictPkg,pkgOrderList::Configured) << " Removed " << List->IsFlag(ConflictPkg,pkgOrderList::Removed) << " Loop " << List->IsFlag(ConflictPkg,pkgOrderList::Loop) << endl;
+ cout << " Delete " << Cache[ConflictPkg].Delete() << endl;
+ }
+
+ if (!List->IsFlag(ConflictPkg,pkgOrderList::Loop)) {
+ if (Cache[ConflictPkg].Keep() == 0 && Cache[ConflictPkg].InstallVer != 0) {
+ cout << "Unpacking " << ConflictPkg.Name() << " to prevent conflict" << endl;
+ List->Flag(Pkg,pkgOrderList::Loop);
+ SmartUnPack(ConflictPkg,false);
+ } else {
+ if (EarlyRemove(ConflictPkg) == false)
+ return _error->Error("Internal Error, Could not early remove %s",ConflictPkg.Name());
+ }
+ } else {
+ if (!List->IsFlag(ConflictPkg,pkgOrderList::Removed)) {
+ cout << "Because of conficts knot, removing " << ConflictPkg.Name() << " to conflict violation" << endl;
+ if (EarlyRemove(ConflictPkg) == false)
+ return _error->Error("Internal Error, Could not early remove %s",ConflictPkg.Name());
+ }
+ }
+ }
+ }
+ }
+
+ // Check for breaks
+ if (End->Type == pkgCache::Dep::DpkgBreaks) {
+ SPtrArray<Version *> VList = End.AllTargets();
+ for (Version **I = VList; *I != 0; I++)
+ {
+ VerIterator Ver(Cache,*I);
+ PkgIterator BrokenPkg = Ver.ParentPkg();
+ VerIterator InstallVer(Cache,Cache[BrokenPkg].InstallVer);
+
+ if (Debug && false) {
+ if (Ver==0) {
+ cout << " Checking if " << Ver << " of " << BrokenPkg.Name() << " satisfies this dependancy" << endl;
+ } else {
+ cout << " Checking if " << Ver.VerStr() << " of " << BrokenPkg.Name() << " satisfies this dependancy" << endl;
+ }
+
+ if (BrokenPkg.CurrentVer()==0) {
+ cout << " CurrentVer " << BrokenPkg.CurrentVer() << " IsNow " << List->IsNow(BrokenPkg) << " NeedsNothing " << (BrokenPkg.State() == PkgIterator::NeedsNothing) << endl;
+ } else {
+ cout << " CurrentVer " << BrokenPkg.CurrentVer().VerStr() << " IsNow " << List->IsNow(BrokenPkg) << " NeedsNothing " << (BrokenPkg.State() == PkgIterator::NeedsNothing) << endl;
+ }
+
+ if (InstallVer==0) {
+ cout << " InstallVer " << InstallVer << endl;
+ } else {
+ cout << " InstallVer " << InstallVer.VerStr() << endl;
+ }
+
+ cout << " Keep " << Cache[BrokenPkg].Keep() << " Unpacked " << List->IsFlag(BrokenPkg,pkgOrderList::UnPacked) << " Configured " << List->IsFlag(BrokenPkg,pkgOrderList::Configured) << " Removed " << List->IsFlag(BrokenPkg,pkgOrderList::Removed) << " Loop " << List->IsFlag(BrokenPkg,pkgOrderList::Loop) << " InList " << List->IsFlag(BrokenPkg,pkgOrderList::InList) << endl;
+ cout << " Delete " << Cache[BrokenPkg].Delete() << endl;
+ }
+ // Check if it needs to be unpacked
+ if (List->IsFlag(BrokenPkg,pkgOrderList::InList) && Cache[BrokenPkg].Delete() == false &&
+ !List->IsFlag(BrokenPkg,pkgOrderList::Loop) && List->IsNow(BrokenPkg)) {
+ List->Flag(Pkg,pkgOrderList::Loop);
+ // Found a break, so unpack the package
+ if (Debug)
+ cout << " Unpacking " << BrokenPkg.Name() << " to avoid break" << endl;
+ /* */
+ SmartUnPack(BrokenPkg, false);
+ }
+ // Check if a package needs to be removed
+ if (Cache[BrokenPkg].Delete() == true && !List->IsFlag(BrokenPkg,pkgOrderList::Configured)) {
+ if (Debug)
+ cout << " Removing " << BrokenPkg.Name() << " to avoid break" << endl;
+ SmartRemove(BrokenPkg);