From: Michael Tremer Date: Sun, 25 Sep 2011 12:54:23 +0000 (+0200) Subject: Allow uninstall of packages on install test. X-Git-Tag: 0.9.10~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=325e60651200d8a2f32c6bcc618b80c8e38f116a;p=pakfire.git 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. --- 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