]> git.ipfire.org Git - pakfire.git/commitdiff
Allow uninstall of packages on install test.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 25 Sep 2011 12:54:23 +0000 (14:54 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 25 Sep 2011 12:54:23 +0000 (14:54 +0200)
Sometimes, we introduce obsoletes or conflicts to packages
and in that case, the install test may fail, if it cannot remove
some packages.

pakfire/base.py
pakfire/builder.py

index 813ed979bf1018b2bc9da2f1fe9d302b9819b2ef..3753477cbe3063a30ad159c241fa2b5104537d51 100644 (file)
@@ -240,7 +240,7 @@ class Pakfire(object):
                # Run the transaction.
                t.run()
 
-       def localinstall(self, files, yes=None):
+       def localinstall(self, files, yes=None, allow_uninstall=False):
                repo_name = repo_desc = "localinstall"
 
                # Create a new repository that holds all packages we passed on
@@ -268,7 +268,7 @@ class Pakfire(object):
                                request.install(solv)
 
                        solver = self.create_solver()
-                       t = solver.solve(request)
+                       t = solver.solve(request, uninstall=allow_uninstall)
 
                        # If solving was not possible, we exit here.
                        if not t:
index f0fd37c9923b99098a48d96f96733d7e94ad54c7..2879834ec40fbe93617d194567c0b95c9e677a87 100644 (file)
@@ -303,7 +303,7 @@ class BuildEnviron(object):
                        for file in files:
                                pkgs.append(os.path.join(dir, file))
 
-               self.pakfire.localinstall(pkgs, yes=True)
+               self.pakfire.localinstall(pkgs, yes=True, allow_uninstall=True)
 
        def chrootPath(self, *args):
                # Remove all leading slashes