From 993168ec5e86b0d6f7f70ad8cb426e6c551df00c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Eray=20=C3=96zkural?= Date: Wed, 8 Mar 2006 11:52:18 +0000 Subject: [PATCH] * check file conflicts --- pisi/atomicoperations.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pisi/atomicoperations.py b/pisi/atomicoperations.py index 4c06b8f0..a99f1021 100644 --- a/pisi/atomicoperations.py +++ b/pisi/atomicoperations.py @@ -150,6 +150,13 @@ class Install(AtomicOperation): if not packagedb.has_package(self.pkginfo.name): db = packagedb.thirdparty_packagedb db.add_package(self.pkginfo) + + # check file conflicts + for file in self.files.list: + if ctx.filesdb.has_file(file.path): + pkg, existing_file = ctx.filesdb.get_file(file.path) + if pkg != self.pkginfo.name: + raise Error(_('Trying to overwrite an existing file: %s') % file.path) def check_reinstall(self): "check reinstall, confirm action, and schedule reinstall"