* fix: do not try to upgrade in place, just calculate an upgrade plan (and that was the intention, uh)
This commit is contained in:
+7
-8
@@ -263,12 +263,13 @@ def upgrade_base(A = set()):
|
|||||||
util.strlist(extra_installs))
|
util.strlist(extra_installs))
|
||||||
G_f, install_order = plan_install_pkg_names(extra_installs)
|
G_f, install_order = plan_install_pkg_names(extra_installs)
|
||||||
extra_upgrades = filter(lambda x: is_upgradable(x, ignore_build), systembase - set(install_order))
|
extra_upgrades = filter(lambda x: is_upgradable(x, ignore_build), systembase - set(install_order))
|
||||||
|
upgrade_order = []
|
||||||
if extra_upgrades:
|
if extra_upgrades:
|
||||||
ctx.ui.warning(_('Safety switch: Following packages in system.base will be upgraded: ') +
|
ctx.ui.warning(_('Safety switch: Following packages in system.base will be upgraded: ') +
|
||||||
util.strlist(extra_upgrades))
|
util.strlist(extra_upgrades))
|
||||||
upgrade_pkg_names(extra_upgrades, bypass_safety=True)
|
G_f, upgrade_order = plan_upgrade(extra_upgrades, ignore_build)
|
||||||
# return packages that must be added to any installation
|
# return packages that must be added to any installation
|
||||||
return set(install_order + extra_upgrades)
|
return set(install_order + upgrade_order)
|
||||||
else:
|
else:
|
||||||
ctx.ui.warning(_('Safety switch: the component system.base cannot be found'))
|
ctx.ui.warning(_('Safety switch: the component system.base cannot be found'))
|
||||||
return set()
|
return set()
|
||||||
@@ -363,7 +364,7 @@ def plan_install_pkg_names(A):
|
|||||||
def upgrade(A):
|
def upgrade(A):
|
||||||
upgrade_pkg_names(A)
|
upgrade_pkg_names(A)
|
||||||
|
|
||||||
def upgrade_pkg_names(A = [], bypass_safety=False):
|
def upgrade_pkg_names(A = []):
|
||||||
"""Re-installs packages from the repository, trying to perform
|
"""Re-installs packages from the repository, trying to perform
|
||||||
a minimum or maximum number of upgrades according to options."""
|
a minimum or maximum number of upgrades according to options."""
|
||||||
|
|
||||||
@@ -408,8 +409,7 @@ def upgrade_pkg_names(A = [], bypass_safety=False):
|
|||||||
ctx.ui.info(_('No packages to upgrade.'))
|
ctx.ui.info(_('No packages to upgrade.'))
|
||||||
return True
|
return True
|
||||||
|
|
||||||
if not bypass_safety:
|
A |= upgrade_base(A)
|
||||||
A |= upgrade_base(A)
|
|
||||||
|
|
||||||
ctx.ui.debug('A = %s' % str(A))
|
ctx.ui.debug('A = %s' % str(A))
|
||||||
|
|
||||||
@@ -683,7 +683,7 @@ def expand_src_components(A):
|
|||||||
## check_conflicts(order)
|
## check_conflicts(order)
|
||||||
## return G_f, order
|
## return G_f, order
|
||||||
|
|
||||||
def emerge(A, rebuild_all = False, bypass_safety = False):
|
def emerge(A, rebuild_all = False):
|
||||||
|
|
||||||
# A was a list, remove duplicates and expand components
|
# A was a list, remove duplicates and expand components
|
||||||
A = [str(x) for x in A]
|
A = [str(x) for x in A]
|
||||||
@@ -694,8 +694,7 @@ def emerge(A, rebuild_all = False, bypass_safety = False):
|
|||||||
ctx.ui.info(_('No packages to emerge.'))
|
ctx.ui.info(_('No packages to emerge.'))
|
||||||
return
|
return
|
||||||
|
|
||||||
#if not bypass_safety:
|
#A |= upgrade_base(A)
|
||||||
# A |= upgrade_base(A)
|
|
||||||
|
|
||||||
if not ctx.config.get_option('ignore_dependency'):
|
if not ctx.config.get_option('ignore_dependency'):
|
||||||
G_f, order_inst, order_build = plan_emerge(A, rebuild_all)
|
G_f, order_inst, order_build = plan_emerge(A, rebuild_all)
|
||||||
|
|||||||
Reference in New Issue
Block a user