Skip to content
Snippets Groups Projects
Commit 0d17256f authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Add --disable option to osc mpcdf_enable_repositories

parent a0138f87
Branches
No related tags found
No related merge requests found
Pipeline #
......@@ -21,6 +21,8 @@ import osc.cmdln
@osc.cmdln.option('--set', nargs=1, metavar="FLAGS",
help="Modify the set of enabled repositories, without this the current setup is displayed. "
"FLAGS is a comma-separated list of a subset of 'system', 'compilers', 'mpi', 'cuda', 'cuda_mpi'")
@osc.cmdln.option('--disable', action="store_true", metavar="FLAGS",
help="Disable building this package")
@osc.cmdln.alias("mpcdf_enable_repos")
def do_mpcdf_enable_repositories(self, subcmd, opts, *args):
"""${cmd_name}: Select all appropriate repositories for an MPCDF package
......@@ -65,7 +67,9 @@ def do_mpcdf_enable_repositories(self, subcmd, opts, *args):
api_url = self.get_api_url()
if opts.set:
if opts.disable:
mpcdf_common.set_attribute_values(api_url, project, package, "MPCDF:enable_repositories", "")
elif opts.set:
mpcdf_common.set_attribute_values(api_url, project, package, "MPCDF:enable_repositories", opts.set.split(","))
def set_or_remove(flag, attribute_name):
......@@ -80,7 +84,7 @@ def do_mpcdf_enable_repositories(self, subcmd, opts, *args):
set_or_remove(opts.cuda_modules, "MPCDF:cuda_modules")
set_or_remove(opts.compiler_modules, "MPCDF:compiler_modules")
if opts.recreate or opts.set:
if opts.recreate or opts.set or opts.disable:
mpcdf_common.mpcdf_enable_repositories(api_url, project, package, verbose=True)
elif (opts.compiler_modules or opts.mpi_modules or opts.cuda_modules):
print("ERROR: Invalid arguments, try --help")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment