- VerIterator Ver(Cache,*I);
- PkgIterator ConflictPkg = Ver.ParentPkg();
- VerIterator InstallVer(Cache,Cache[ConflictPkg].InstallVer);
-
- // See if the current version is conflicting
- if (ConflictPkg.CurrentVer() == Ver && List->IsNow(ConflictPkg))
- {
- cout << OutputInDepth(Depth) << 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 << OutputInDepth(Depth) << OutputInDepth(Depth) << "Unpacking " << ConflictPkg.Name() << " to prevent conflict" << endl;
- List->Flag(Pkg,pkgOrderList::Loop);
- SmartUnPack(ConflictPkg,false, Depth + 1);
- // 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());
- }
- } else {
- if (!List->IsFlag(ConflictPkg,pkgOrderList::Removed)) {
- if (Debug)
- cout << OutputInDepth(Depth) << "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());
- }
+ /* Look for conflicts. Two packages that are both in the install
+ state cannot conflict so we don't check.. */
+ SPtrArray<Version *> VList = End.AllTargets();
+ for (Version **I = VList; *I != 0; I++)
+ {
+ VerIterator Ver(Cache,*I);
+ PkgIterator ConflictPkg = Ver.ParentPkg();
+ VerIterator InstallVer(Cache,Cache[ConflictPkg].InstallVer);
+
+ // See if the current version is conflicting
+ if (ConflictPkg.CurrentVer() == Ver && List->IsNow(ConflictPkg))
+ {
+ clog << OutputInDepth(Depth) << Pkg.FullName() << " conflicts with " << ConflictPkg.FullName() << 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) == false)
+ {
+ if (Cache[ConflictPkg].Keep() == 0 && Cache[ConflictPkg].InstallVer != 0)
+ {
+ if (Debug)
+ clog << OutputInDepth(Depth) << OutputInDepth(Depth) << "Unpacking " << ConflictPkg.FullName() << " to prevent conflict" << endl;
+ List->Flag(Pkg,pkgOrderList::Loop);
+ if (SmartUnPack(ConflictPkg,false, Depth + 1) == true)
+ if (List->IsFlag(ConflictPkg,pkgOrderList::Loop) == false)
+ Changed = true;
+ // 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 (1)",ConflictPkg.FullName().c_str());
+ }
+ else if (List->IsFlag(ConflictPkg,pkgOrderList::Removed) == false)
+ {
+ if (Debug)
+ clog << OutputInDepth(Depth) << "Because of conficts knot, removing " << ConflictPkg.FullName() << " to conflict violation" << endl;
+ if (EarlyRemove(ConflictPkg) == false)
+ return _error->Error("Internal Error, Could not early remove %s (2)",ConflictPkg.FullName().c_str());
+ }