* fix: make it possible to bypass safety switch by returning empty set
in upgrade_base function and removing cruft left from an early revision
This commit is contained in:
+5
-6
@@ -271,8 +271,9 @@ def upgrade_base(A = set()):
|
|||||||
return set(install_order + extra_upgrades)
|
return set(install_order + extra_upgrades)
|
||||||
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()
|
||||||
|
|
||||||
def install_pkg_names(A, reinstall = False, bypass_safety = False):
|
def install_pkg_names(A, reinstall = False):
|
||||||
"""This is the real thing. It installs packages from
|
"""This is the real thing. It installs packages from
|
||||||
the repository, trying to perform a minimum number of
|
the repository, trying to perform a minimum number of
|
||||||
installs"""
|
installs"""
|
||||||
@@ -295,8 +296,7 @@ def install_pkg_names(A, reinstall = False, bypass_safety = False):
|
|||||||
ctx.ui.info(_('No packages to install.'))
|
ctx.ui.info(_('No packages to install.'))
|
||||||
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 = plan_install_pkg_names(A)
|
G_f, order = plan_install_pkg_names(A)
|
||||||
@@ -363,7 +363,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 +408,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))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user