- /* Check for a loop to prevent one forming
- If A depends on B and B depends on A, SmartConfigure will
- just hop between them if this is not checked */
- if (!List->IsFlag(DepPkg,pkgOrderList::Loop)) {
- List->Flag(Pkg,pkgOrderList::Loop);
- // If SmartConfigure was succesfull, Bad is false, so break
- Bad = !SmartConfigure(DepPkg);
- List->RmFlag(Pkg,pkgOrderList::Loop);
- if (!Bad) break;
+ if (List->IsFlag(DepPkg,pkgOrderList::Loop) && PkgLoop) {
+ // This dependancy has already been dealt with by another SmartConfigure on Pkg
+ Bad = false;
+ break;
+ } else if (List->IsFlag(Pkg,pkgOrderList::Loop)) {
+ /* Check for a loop to prevent one forming
+ If A depends on B and B depends on A, SmartConfigure will
+ just hop between them if this is not checked. Dont remove the
+ loop flag after finishing however as loop is already set.
+ This means that there is another SmartConfigure call for this
+ package and it will remove the loop flag */
+ Bad = !SmartConfigure(DepPkg, Depth + 1);
+ } else {
+ /* Check for a loop to prevent one forming
+ If A depends on B and B depends on A, SmartConfigure will
+ just hop between them if this is not checked */
+ List->Flag(Pkg,pkgOrderList::Loop);
+ Bad = !SmartConfigure(DepPkg, Depth + 1);
+ List->RmFlag(Pkg,pkgOrderList::Loop);