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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mpcdf
obs
osc-plugins
Commits
6bb1d774
Commit
6bb1d774
authored
5 years ago
by
Lorenz Hüdepohl
Browse files
Options
Downloads
Patches
Plain Diff
Add CentOS-specific macros and Tags
parent
645d0030
No related branches found
No related tags found
1 merge request
!3
Merge changes for new OBS from obs-api branch
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
mpcdf_common.py
+27
-1
27 additions, 1 deletion
mpcdf_common.py
mpcdf_setup_software_project.py
+24
-5
24 additions, 5 deletions
mpcdf_setup_software_project.py
with
51 additions
and
6 deletions
mpcdf_common.py
+
27
−
1
View file @
6bb1d774
...
...
@@ -6,6 +6,7 @@ import osc
import
osc.conf
import
osc.core
import
osc.oscerr
import
textwrap
from
functools
import
partial
from
xml.etree
import
ElementTree
...
...
@@ -47,6 +48,23 @@ compiler_parallel_studio = {value["compiler"]: dict({"ps": key}, **value) for ke
prjconf_start_marker
=
"
# Autogenerated by osc mpcdf_setup_repos, do not edit till end of section
\n
"
prjconf_end_marker
=
"
# End of autogenerated section
\n
"
centos_prjconf_tags
=
textwrap
.
dedent
(
"""
Prefer: perl-Error
Substitute: c_compiler gcc
Substitute: c++_compiler gcc-c++
Substitute: ca-certificates-mozilla ca-certificates
"""
).
strip
()
centos_macros
=
textwrap
.
dedent
(
"""
# Disable all problematic automatic RPM stuff
# like byte-compiling (with the wrong Python version)
# or debug packages that fail for many binary-only packages
%__no_python_bytecompile 1
%debug_package %{nil}
"""
).
strip
()
def
check_for_update
():
import
os
...
...
@@ -555,10 +573,18 @@ def mpcdf_setup_subproject(api_url, project, distribution, microarchitecture,
prjconf_ours
.
append
(
"
Constraint: hostlabel {0}
"
.
format
(
microarchitecture
))
prjconf_ours
.
append
(
"
PublishFilter: ^mpcdf_.*$
"
)
if
"
CentOS
"
in
distribution
:
prjconf_ours
.
append
(
centos_prjconf_tags
)
extra_macros
=
centos_macros
else
:
extra_macros
=
""
prjconf_ours
.
append
(
"""
Macros:
%microarchitecture {0}
:Macros
"""
.
format
(
microarchitecture
))
{1}
:Macros
"""
.
format
(
microarchitecture
,
extra_macros
))
prjconf_ours
.
append
(
""
)
# Remove existing repositories
...
...
This diff is collapsed.
Click to expand it.
mpcdf_setup_software_project.py
+
24
−
5
View file @
6bb1d774
...
...
@@ -9,6 +9,8 @@ import osc.cmdln
import
mpcdf_common
@osc.cmdln.option
(
'
-n
'
,
'
--dry-run
'
,
action
=
"
store_true
"
,
help
=
"
Do not actually run anything but output the resulting XML configuration
"
)
@osc.cmdln.option
(
'
-i
'
,
'
--ignore-repo
'
,
action
=
"
append
"
,
default
=
[],
metavar
=
"
REPO
"
,
help
=
"
Do not enable for repository REPO
"
)
@osc.cmdln.alias
(
"
mpcdf_setup_software
"
)
...
...
@@ -55,13 +57,30 @@ def do_mpcdf_setup_software_project(self, subcmd, opts, *args):
prjconf
.
append
(
"
Preinstall: mpcdf_modules
"
)
prjconf
.
append
(
"
Preinstall: brp_mpcdf_modules
"
)
software_meta
=
mpcdf_common
.
project_meta
(
api_url
,
"
software
"
)
distributions
=
(
repo
.
get
(
"
name
"
)
for
repo
in
software_meta
.
findall
(
'
./repository
'
))
centos_distributions
=
list
(
distro
for
distro
in
distributions
if
"
CentOS
"
in
distro
)
if
centos_distributions
:
prjconf
.
append
(
""
)
prjconf
.
append
(
"
%if {0}
"
.
format
(
"
||
"
.
join
(
'"
%_repository
"
==
"
{0}
"'
.
format
(
c
)
for
c
in
centos_distributions
)))
prjconf
.
append
(
mpcdf_common
.
centos_prjconf_tags
)
prjconf
.
append
(
""
)
prjconf
.
append
(
"
Macros:
"
)
prjconf
.
append
(
mpcdf_common
.
centos_macros
)
prjconf
.
append
(
"
:Macros
"
)
prjconf
.
append
(
"
%endif
"
)
prjconf
.
append
(
end_marker
)
prjconf
=
prjconf_head
+
"
\n
"
.
join
(
prjconf
)
+
prjconf_tail
osc
.
core
.
edit_meta
(
"
prjconf
"
,
"
software
"
,
data
=
prjconf
)
if
opts
.
ignore_repo
:
ignore_repos
=
opts
.
ignore_repo
if
opts
.
dry_run
:
print
(
"
osc meta prjconf software -F - <<EOF
\n
{0}
\n
EOF
\n
"
.
format
(
prjconf
))
else
:
ignore_repos
=
()
osc
.
core
.
edit_meta
(
"
prjconf
"
,
"
software
"
,
data
=
prjconf
)
if
opts
.
ignore_repo
:
ignore_repos
=
opts
.
ignore_repo
else
:
ignore_repos
=
()
mpcdf_common
.
mpcdf_enable_repositories_for_all_packages
(
api_url
,
"
software
"
,
ignore_repos
=
ignore_repos
)
mpcdf_common
.
mpcdf_enable_repositories_for_all_packages
(
api_url
,
"
software
"
,
ignore_repos
=
ignore_repos
)
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
register
or
sign in
to comment