From ffc64fc06ff880ab7393b09041859522746c8e86 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 26 Oct 2006 10:58:39 +0000 Subject: [PATCH] * We will pass the conflicting package if it is in the order at the first check, because the package that is installed may be a conflicting one but the same package in the order (that is going to be installed) may not be a conflicting one. The second test shows us that. If it is then nothing can be done. example: a version 4 is installed b version 1 is installed a is upgraded to 5 b is upgraded to version 2 but now conflicts with a versionTo 4 now the first check finds the installed a and complains that this is a conflict. But a version 5 is already in the order that is going to replace version 4. And if the second test does not fail (packages that are going to be installed are not conflicting with each other) then this is a go go go. (see bug3865scen) * more comments added. --- pisi/operations.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pisi/operations.py b/pisi/operations.py index 3a311f60..1c103298 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -194,11 +194,11 @@ in the respective order to satisfy extra dependencies: if 'pisi' in order and pisi_installed: upgrade_pisi() -def check_conflict(pkg): +def check_conflict(pkg, order): conflicts = [] for conflict in pkg.conflicts: - if pisi.conflict.installed_package_conflicts(conflict): + if conflict.package not in order and pisi.conflict.installed_package_conflicts(conflict): conflicts.append(conflict) return conflicts @@ -210,17 +210,17 @@ def calculate_conflicts(order, packagedb): for x in order: pkg = packagedb.get_package(x) - conflicts = check_conflict(pkg) + + # check if any package has conflicts with the installed packages + conflicts = check_conflict(pkg, order) if conflicts: pkg_conflicts[x] = map(lambda c:str(c), conflicts) C = C.union(map(lambda c:c.package, conflicts)) + # now check if any package has conflicts with each other B_i = B_0.intersection(set(map(lambda c:c.package, pkg.conflicts))) D_i = set() - # check if there are any conflicts within the packages that are - # going to be installed for p in map(lambda x:packagedb.get_package(x), B_i): - # check if they are really conflicting conflicted = pisi.conflict.package_conflicts(p, pkg.conflicts) if conflicted: D_i.add(str(conflicted))