Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
8ee5d62f
Commit
8ee5d62f
authored
Oct 26, 2021
by
Lorenz Hüdepohl
Browse files
Option '--remove-old-matching' for subproject setup
parent
0267c7fc
Changes
3
Hide whitespace changes
Inline
Side-by-side
mpcdf_common.py
View file @
8ee5d62f
...
...
@@ -611,7 +611,8 @@ def parse_prjconf(api_url, project):
def
mpcdf_setup_subproject
(
api_url
,
project
,
distribution
,
microarchitecture
,
parent
=
None
,
dry_run
=
False
,
diff
=
False
,
remove_old
=
False
,
all_possible
=
False
,
only_project
=
False
):
parent
=
None
,
dry_run
=
False
,
diff
=
False
,
remove_old
=
False
,
remove_old_matching
=
None
,
all_possible
=
False
,
only_project
=
False
):
import
re
if
parent
and
not
dry_run
:
for
attribute
in
config_attributes
:
...
...
@@ -666,6 +667,10 @@ Macros:
if
remove_old
:
for
oldrepo
in
root
.
findall
(
"./repository"
):
root
.
remove
(
oldrepo
)
if
remove_old_matching
:
for
oldrepo
in
root
.
findall
(
"./repository"
):
if
re
.
search
(
remove_old_matching
,
oldrepo
.
attrib
[
"name"
]):
root
.
remove
(
oldrepo
)
def
repo
(
name
,
dependencies
,
compiler
=
False
,
mpi
=
False
,
cuda
=
False
,
cuda_mpi
=
False
,
cuda_aware_mpi
=
False
,
additional_tags
=
(),
**
macros
):
old_repos
.
discard
(
name
)
...
...
mpcdf_setup_home_project.py
View file @
8ee5d62f
...
...
@@ -13,6 +13,8 @@ import osc.cmdln
help
=
"Do not actually run anything but output the resulting XML configuration"
)
@
osc
.
cmdln
.
option
(
'--remove-old'
,
action
=
"store_true"
,
default
=
False
,
help
=
"Remove all obsolete repositories instead of only disabling builds for packages there"
)
@
osc
.
cmdln
.
option
(
'--remove-old-matching'
,
default
=
None
,
help
=
"Remove all obsolete repositories matching this regular expression"
)
@
osc
.
cmdln
.
option
(
'--distribution'
,
metavar
=
"DIST"
,
nargs
=
1
,
help
=
"Base distribution, necessary argument unless set previously for this project. "
"Valid arguments are the names of any repository in the 'software' project."
)
...
...
@@ -78,4 +80,7 @@ def do_mpcdf_setup_home_project(self, subcmd, opts, *args):
mpcdf_setup_subproject
(
api_url
,
project
,
distribution
,
microarchitecture
,
parent
=
parent
,
dry_run
=
opts
.
dry_run
,
remove_old
=
opts
.
remove_old
)
parent
=
parent
,
dry_run
=
opts
.
dry_run
,
diff
=
opts
.
diff
,
remove_old
=
opts
.
remove_old
,
remove_old_matching
=
opts
.
remove_old_matching
,
only_project
=
opts
.
only_project
)
mpcdf_setup_subproject.py
View file @
8ee5d62f
...
...
@@ -17,6 +17,8 @@ import osc.cmdln
help
=
"Only change project metadata, do not iterate over packages and change their enabled repositories"
)
@
osc
.
cmdln
.
option
(
'--remove-old'
,
action
=
"store_true"
,
default
=
False
,
help
=
"Remove all obsolete repositories instead of only disabling builds for packages there"
)
@
osc
.
cmdln
.
option
(
'--remove-old-matching'
,
default
=
None
,
help
=
"Remove all obsolete repositories matching this regular expression"
)
@
osc
.
cmdln
.
alias
(
"mpcdf_setup_sub"
)
def
do_mpcdf_setup_subproject
(
self
,
subcmd
,
opts
,
*
args
):
"""${cmd_name}: Setup a software: sub-project
...
...
@@ -53,4 +55,6 @@ def do_mpcdf_setup_subproject(self, subcmd, opts, *args):
mpcdf_setup_subproject
(
self
.
get_api_url
(),
project
,
distribution
,
microarchitecture
,
dry_run
=
opts
.
dry_run
,
diff
=
opts
.
diff
,
remove_old
=
opts
.
remove_old
,
only_project
=
opts
.
only_project
)
dry_run
=
opts
.
dry_run
,
diff
=
opts
.
diff
,
remove_old
=
opts
.
remove_old
,
remove_old_matching
=
opts
.
remove_old_matching
,
only_project
=
opts
.
only_project
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment