From 0379d0e76a66b9710c297095fbfb7f4cd058c753 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Mon, 18 Jun 2007 06:39:17 +0000 Subject: [PATCH] - A way to see if file conflict problem will not be an issue when all the packages in "order" is installed. --- pisi/atomicoperations.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index fb2a923d..a5642e77 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -161,13 +161,23 @@ class Install(AtomicOperation): if not ctx.packagedb.has_package(self.pkginfo.name): ctx.packagedb.add_package(self.pkginfo, pisi.itembyrepodb.thirdparty) + # If it is explicitly specified that package conflicts with this package and also + # we passed check_conflicts tests in operations.py than this means a non-conflicting + # pkg is in "order" to be installed that has no file conflict problem with this package. + # PS: we need this because "order" generating code does not consider conflicts. + def really_conflicts(pkg): + if not self.pkginfo.conflicts: + return True + + return not pkg in map(lambda x:x.package, self.pkginfo.conflicts) + # check file conflicts file_conflicts = [] for f in self.files.list: if ctx.filesdb.has_file(f.path): pkg, existing_file = ctx.filesdb.get_file(f.path) dst = pisi.util.join_path(ctx.config.dest_dir(), f.path) - if pkg != self.pkginfo.name and not os.path.isdir(dst): + if pkg != self.pkginfo.name and not os.path.isdir(dst) and really_conflicts(pkg): file_conflicts.append( (pkg, existing_file) ) if file_conflicts: file_conflicts_str = ""