Any package should remove the package it replaces before it is installed.

This is a fix for a problem where a package replaces another in system.base
User tries to install a single package outside of system.base .. safety
forces to install the system.base packages... but because the package does
not remove the replaced package before it gives file conflicts an stops
installation. (udev - udev-extras ex.)
This commit is contained in:
Faik Uygur
2009-09-08 08:35:17 +00:00
parent 49b49aa0a5
commit 2e6edcf631
2 changed files with 9 additions and 1 deletions
+9
View File
@@ -139,6 +139,10 @@ class Install(AtomicOperation):
self.operation = INSTALL
def install(self, ask_reinstall = True):
# Any package should remove the package it replaces before
self.check_replaces()
ctx.ui.status(_('Installing %s, version %s, release %s, build %s') %
(self.pkginfo.name, self.pkginfo.version,
self.pkginfo.release, self.pkginfo.build))
@@ -175,6 +179,11 @@ class Install(AtomicOperation):
import pisi.comariface as comariface
comariface.get_link()
def check_replaces(self):
for replaced in self.pkginfo.replaces:
if self.installdb.has_package(replaced.package):
pisi.operations.remove.remove_replaced_packages([replaced.package])
def check_versioning(self, version):
if not pisi.version.Version.valid(version):
raise Error("%s is not a valid PiSi version format" % version)
-1
View File
@@ -165,7 +165,6 @@ def upgrade(A=[], repo=None):
if conflicts:
operations.remove.remove_conflicting_packages(conflicts)
operations.remove.remove_replaced_packages(replaces.keys())
operations.remove.remove_obsoleted_packages()
for path in paths: