Kaydet (Commit) 29ad0954 authored tarafından Faik Uygur's avatar Faik Uygur

* bypass_safety to ignore_safety for conveniency purpose.

üst 681be209
...@@ -406,7 +406,7 @@ class Builder: ...@@ -406,7 +406,7 @@ class Builder:
build_deps = self.spec.source.buildDependencies build_deps = self.spec.source.buildDependencies
if not ctx.get_option('bypass_safety'): if not ctx.get_option('ignore_safety'):
if ctx.componentdb.has_component('system.devel'): if ctx.componentdb.has_component('system.devel'):
build_deps_names = set([x.package for x in build_deps]) build_deps_names = set([x.package for x in build_deps])
devel_deps_names = set(ctx.componentdb.get_component('system.devel').packages) devel_deps_names = set(ctx.componentdb.get_component('system.devel').packages)
......
...@@ -447,7 +447,7 @@ to be downloaded from a repository containing sources. ...@@ -447,7 +447,7 @@ to be downloaded from a repository containing sources.
group.add_option("--ignore-action-errors", group.add_option("--ignore-action-errors",
action="store_true", default=False, action="store_true", default=False,
help=_("Bypass errors from ActionsAPI")) help=_("Bypass errors from ActionsAPI"))
group.add_option("--bypass-safety", action="store_true", group.add_option("--ignore-safety", action="store_true",
default=False, help=_("Bypass safety switch")) default=False, help=_("Bypass safety switch"))
group.add_option("--ignore-file-conflicts", action="store_true", group.add_option("--ignore-file-conflicts", action="store_true",
default=False, help=_("Ignore file conflicts")) default=False, help=_("Ignore file conflicts"))
...@@ -554,7 +554,7 @@ class PackageOp(Command): ...@@ -554,7 +554,7 @@ class PackageOp(Command):
ignoredep_opt(self, group) ignoredep_opt(self, group)
group.add_option("--ignore-comar", action="store_true", group.add_option("--ignore-comar", action="store_true",
default=False, help=_("Bypass comar configuration agent")) default=False, help=_("Bypass comar configuration agent"))
group.add_option("--bypass-safety", action="store_true", group.add_option("--ignore-safety", action="store_true",
default=False, help=_("Bypass safety switch")) default=False, help=_("Bypass safety switch"))
group.add_option("-n", "--dry-run", action="store_true", default=False, group.add_option("-n", "--dry-run", action="store_true", default=False,
help = _("Do not perform any action, just show what would be done")) help = _("Do not perform any action, just show what would be done"))
......
...@@ -245,7 +245,7 @@ def check_conflicts(order, packagedb): ...@@ -245,7 +245,7 @@ def check_conflicts(order, packagedb):
if not ctx.ui.confirm(_('Remove the following conflicting packages?')): if not ctx.ui.confirm(_('Remove the following conflicting packages?')):
raise Error(_("Conflicts remain")) raise Error(_("Conflicts remain"))
if remove(list(C), ignore_dep=True, bypass_safety=True) == False: if remove(list(C), ignore_dep=True, ignore_safety=True) == False:
raise Error(_("Conflicts remain")) raise Error(_("Conflicts remain"))
def expand_components(A): def expand_components(A):
...@@ -272,7 +272,7 @@ def is_upgradable(name, ignore_build = False): ...@@ -272,7 +272,7 @@ def is_upgradable(name, ignore_build = False):
def upgrade_base(A = set()): def upgrade_base(A = set()):
ignore_build = ctx.get_option('ignore_build_no') ignore_build = ctx.get_option('ignore_build_no')
if not ctx.get_option('bypass_safety'): if not ctx.get_option('ignore_safety'):
if ctx.componentdb.has_component('system.base'): if ctx.componentdb.has_component('system.base'):
systembase = set(ctx.componentdb.get_union_comp('system.base').packages) systembase = set(ctx.componentdb.get_union_comp('system.base').packages)
extra_installs = filter(lambda x: not ctx.installdb.is_installed(x), systembase - A) extra_installs = filter(lambda x: not ctx.installdb.is_installed(x), systembase - A)
...@@ -549,7 +549,7 @@ def plan_upgrade(A, ignore_build = False): ...@@ -549,7 +549,7 @@ def plan_upgrade(A, ignore_build = False):
check_conflicts(order, ctx.packagedb) check_conflicts(order, ctx.packagedb)
return G_f, order return G_f, order
def remove(A, ignore_dep = False, bypass_safety = False): def remove(A, ignore_dep = False, ignore_safety = False):
"""remove set A of packages from system (A is a list of package names)""" """remove set A of packages from system (A is a list of package names)"""
A = [str(x) for x in A] A = [str(x) for x in A]
...@@ -557,7 +557,7 @@ def remove(A, ignore_dep = False, bypass_safety = False): ...@@ -557,7 +557,7 @@ def remove(A, ignore_dep = False, bypass_safety = False):
# filter packages that are not installed # filter packages that are not installed
A_0 = A = expand_components(set(A)) A_0 = A = expand_components(set(A))
if not ctx.get_option('bypass_safety') and not bypass_safety: if not ctx.get_option('ignore_safety') and not ignore_safety:
if ctx.componentdb.has_component('system.base'): if ctx.componentdb.has_component('system.base'):
systembase = set(ctx.componentdb.get_union_comp('system.base').packages) systembase = set(ctx.componentdb.get_union_comp('system.base').packages)
refused = A.intersection(systembase) refused = A.intersection(systembase)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment