From 325e60651200d8a2f32c6bcc618b80c8e38f116a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 25 Sep 2011 14:54:23 +0200 Subject: [PATCH] Allow uninstall of packages on install test. 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 | 4 ++-- pakfire/builder.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pakfire/base.py b/pakfire/base.py index 813ed979b..3753477cb 100644 --- a/pakfire/base.py +++ b/pakfire/base.py @@ -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: diff --git a/pakfire/builder.py b/pakfire/builder.py index f0fd37c99..2879834ec 100644 --- a/pakfire/builder.py +++ b/pakfire/builder.py @@ -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 -- 2.39.5