Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osc-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
obs
osc-plugins
Commits
8ee5d62f
Commit
8ee5d62f
authored
Oct 26, 2021
by
Lorenz Hüdepohl
Browse files
Options
Downloads
Patches
Plain Diff
Option '--remove-old-matching' for subproject setup
parent
0267c7fc
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
mpcdf_common.py
+6
-1
6 additions, 1 deletion
mpcdf_common.py
mpcdf_setup_home_project.py
+6
-1
6 additions, 1 deletion
mpcdf_setup_home_project.py
mpcdf_setup_subproject.py
+5
-1
5 additions, 1 deletion
mpcdf_setup_subproject.py
with
17 additions
and
3 deletions
mpcdf_common.py
+
6
−
1
View file @
8ee5d62f
...
@@ -611,7 +611,8 @@ def parse_prjconf(api_url, project):
...
@@ -611,7 +611,8 @@ def parse_prjconf(api_url, project):
def
mpcdf_setup_subproject
(
api_url
,
project
,
distribution
,
microarchitecture
,
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
:
if
parent
and
not
dry_run
:
for
attribute
in
config_attributes
:
for
attribute
in
config_attributes
:
...
@@ -666,6 +667,10 @@ Macros:
...
@@ -666,6 +667,10 @@ Macros:
if
remove_old
:
if
remove_old
:
for
oldrepo
in
root
.
findall
(
"
./repository
"
):
for
oldrepo
in
root
.
findall
(
"
./repository
"
):
root
.
remove
(
oldrepo
)
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
):
def
repo
(
name
,
dependencies
,
compiler
=
False
,
mpi
=
False
,
cuda
=
False
,
cuda_mpi
=
False
,
cuda_aware_mpi
=
False
,
additional_tags
=
(),
**
macros
):
old_repos
.
discard
(
name
)
old_repos
.
discard
(
name
)
...
...
...
...
This diff is collapsed.
Click to expand it.
mpcdf_setup_home_project.py
+
6
−
1
View file @
8ee5d62f
...
@@ -13,6 +13,8 @@ import osc.cmdln
...
@@ -13,6 +13,8 @@ import osc.cmdln
help
=
"
Do not actually run anything but output the resulting XML configuration
"
)
help
=
"
Do not actually run anything but output the resulting XML configuration
"
)
@osc.cmdln.option
(
'
--remove-old
'
,
action
=
"
store_true
"
,
default
=
False
,
@osc.cmdln.option
(
'
--remove-old
'
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
Remove all obsolete repositories instead of only disabling builds for packages there
"
)
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
,
@osc.cmdln.option
(
'
--distribution
'
,
metavar
=
"
DIST
"
,
nargs
=
1
,
help
=
"
Base distribution, necessary argument unless set previously for this project.
"
help
=
"
Base distribution, necessary argument unless set previously for this project.
"
"
Valid arguments are the names of any repository in the
'
software
'
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):
...
@@ -78,4 +80,7 @@ def do_mpcdf_setup_home_project(self, subcmd, opts, *args):
mpcdf_setup_subproject
(
api_url
,
mpcdf_setup_subproject
(
api_url
,
project
,
distribution
,
microarchitecture
,
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
)
This diff is collapsed.
Click to expand it.
mpcdf_setup_subproject.py
+
5
−
1
View file @
8ee5d62f
...
@@ -17,6 +17,8 @@ import osc.cmdln
...
@@ -17,6 +17,8 @@ import osc.cmdln
help
=
"
Only change project metadata, do not iterate over packages and change their enabled repositories
"
)
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
,
@osc.cmdln.option
(
'
--remove-old
'
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
Remove all obsolete repositories instead of only disabling builds for packages there
"
)
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
"
)
@osc.cmdln.alias
(
"
mpcdf_setup_sub
"
)
def
do_mpcdf_setup_subproject
(
self
,
subcmd
,
opts
,
*
args
):
def
do_mpcdf_setup_subproject
(
self
,
subcmd
,
opts
,
*
args
):
"""
${cmd_name}: Setup a software: sub-project
"""
${cmd_name}: Setup a software: sub-project
...
@@ -53,4 +55,6 @@ def do_mpcdf_setup_subproject(self, subcmd, opts, *args):
...
@@ -53,4 +55,6 @@ def do_mpcdf_setup_subproject(self, subcmd, opts, *args):
mpcdf_setup_subproject
(
self
.
get_api_url
(),
mpcdf_setup_subproject
(
self
.
get_api_url
(),
project
,
distribution
,
microarchitecture
,
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
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
sign in
to comment