From 14c7c5f11274718ca439193194d22833ed5f1128 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Sun, 26 Nov 2006 21:46:26 +0000 Subject: [PATCH] * this thing is broken since 1.1_beta8. Before that, upgrade_base was downloading and installing or downloading and upgrading the needed system.base packages within itself. And the requested operation was then continuing. When the "upgrades will be done after downloading all the necessary packages" change is made, upgrade_base function started to _return_ the system.base order set and things are broken then. this time what we are doing is real safe. we just take out the system.base packages from the _created_ order and reorder them to the beginning without changing any dep order of any package. --- pisi/operations.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/pisi/operations.py b/pisi/operations.py index 8ed97124..1aff30ac 100644 --- a/pisi/operations.py +++ b/pisi/operations.py @@ -89,6 +89,20 @@ def install(packages, reinstall = False, ignore_file_conflicts=False): else: return install_pkg_names(packages, reinstall) +def reorder_base_packages(order): + """system.base packages must be first in order""" + systembase = ctx.componentdb.get_union_comp('system.base').packages + + systembase_order = [] + nonbase_order = [] + for pkg in order: + if pkg in systembase: + systembase_order.append(pkg) + else: + nonbase_order.append(pkg) + + return systembase_order + nonbase_order + def install_pkg_files(package_URIs): """install a number of pisi package files""" from package import Package @@ -333,6 +347,10 @@ def install_pkg_names(A, reinstall = False): G_f = None order = list(A) + # Bug 4211 + if ctx.componentdb.has_component('system.base'): + order = reorder_base_packages(order) + if len(order) > 1: ctx.ui.info(_("Following packages will be installed in the respective " "order to satisfy dependencies:\n") + util.strlist(order)) @@ -458,6 +476,10 @@ def upgrade_pkg_names(A = []): G_f = None order = list(A) + # Bug 4211 + if ctx.componentdb.has_component('system.base'): + order = reorder_base_packages(order) + if not ctx.get_option('ignore_package_conflicts'): conflicts = check_conflicts(order, ctx.packagedb)