Kaydet (Commit) d7d2cc2b authored tarafından Eray Özkural's avatar Eray Özkural

* fix: report file conflicts as errors

üst 617ce978
......@@ -154,12 +154,17 @@ class Install(AtomicOperation):
ctx.packagedb.add_package(self.pkginfo, pisi.itembyrepodb.thirdparty)
# check file conflicts
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)
ctx.ui.warning(_('Trying to overwrite an existing file: %s') % file.path)
file_conflicts.append( (pkg, existing_file) )
if file_conflicts:
file_conflicts_str = ""
for (pkg, existing_file) in file_conflicts:
file_conflicts_str += _("%s from %s package") % (existing_file.path, pkg)
raise Error(_('File conflicts:\n%s') % file_conflicts_str)
def check_reinstall(self):
"check reinstall, confirm action, and schedule reinstall"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment