From 2f98b5c735fdf261619ef9523b66b4947ac10ef2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Metin?= Date: Fri, 9 Jun 2006 12:30:51 +0000 Subject: [PATCH] shouldn't remove conflicted files... --- pisi/atomicoperations.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index b6ac6402..84250214 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -406,6 +406,15 @@ class Remove(AtomicOperation): def remove_file(fileinfo): fpath = pisi.util.join_path(ctx.config.dest_dir(), fileinfo.path) + + # we should check if the file is also provided by another + # package (this is clearly the package's fault but we + # shouldn't left system in an inconsistent state). + if ctx.filesdb.has_file(fpath): + pkg, existing_file = ctx.filesdb.get_file(fpath) + if pkg != self.package_name: + ctx.ui.warning(_('Not removing conflicted file : %s') % fpath) + # TODO: We have to store configuration files for futher # usage. Currently we'are doing it like rpm does, saving # with a prefix and leaving the user to edit it. In the future