Commit aa71410c authored by Lorenz Hüdepohl's avatar Lorenz Hüdepohl
Browse files

CentOS 8 specific updates

parent f1d6ad3d
Pipeline #71673 failed with stage
in 14 seconds
......@@ -48,22 +48,45 @@ 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 dist_prjconf_tags(distribution):
centos_prjconf_tags = textwrap.dedent(
"""
Prefer: perl-Error
Substitute: c_compiler gcc
Substitute: c++_compiler gcc-c++
Substitute: ca-certificates-mozilla ca-certificates
""").strip()
centos8_prjconf_tags = textwrap.dedent(
"""
ExpandFlags: module:python36-3.6
""").strip()
res = ""
if "CentOS" in distribution:
res += centos_prjconf_tags
if "CentOS_8" in distribution:
res += "\n" + centos8_prjconf_tags
return res
def dist_prjconf_macros(distribution):
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()
res = ""
if "CentOS" in distribution:
res += centos_macros
return res
def check_for_update():
......@@ -575,11 +598,10 @@ def mpcdf_setup_subproject(api_url, project, distribution, microarchitecture,
prjconf_ours.append("Preinstall: mpcdf_{0}_directory".format(microarchitecture))
prjconf_ours.append("PublishFilter: ^mpcdf_.*$")
if "CentOS" in distribution:
prjconf_ours.append(centos_prjconf_tags)
extra_macros = centos_macros
else:
extra_macros = ""
extra_tags = dist_prjconf_tags(distribution)
if extra_tags:
prjconf_ours.append(extra_tags)
extra_macros = dist_prjconf_macros(distribution)
prjconf_ours.append("""
Macros:
......
......@@ -59,17 +59,21 @@ def do_mpcdf_setup_software_project(self, subcmd, opts, *args):
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")
distributions = sorted(repo.get("name") for repo in software_meta.findall('./repository'))
for distribution in distributions:
extra_tags = mpcdf_common.dist_prjconf_tags(distribution)
extra_macros = mpcdf_common.dist_prjconf_macros(distribution)
if len(extra_tags) > 0 or len(extra_macros) > 0:
prjconf.append("")
prjconf.append("%if \"%_repository\" == \"{0}\"".format(distribution))
prjconf.append(extra_tags)
prjconf.append("")
prjconf.append("Macros:")
prjconf.append(extra_macros)
prjconf.append(":Macros")
prjconf.append("%endif")
prjconf.append(end_marker)
prjconf = prjconf_head + "\n".join(prjconf) + prjconf_tail
......
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