Commit 44860d76 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Macros %latest_intel and %latest_gcc in prjconf of software:dist

parent ef6b515c
Pipeline #67006 passed with stage
in 18 seconds
......@@ -306,6 +306,12 @@ def get_microarchitecture(project):
raise Exception("Unknown micro-architecture '{0}'".format(microarch))
def package_sort_key(string):
name, version = string.split("_", 1)
version = version.split("_")
return (name,) + tuple(map(int, version))
def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_repos=None):
from itertools import product
import sys
......@@ -355,13 +361,8 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, filter_r
default_mpis = try_get_attribute(None, "default_mpi")
default_cudas = try_get_attribute(None, "default_cuda")
def sort_key(string):
name, version = string.split("_", 1)
version = version.split("_")
return (name,) + tuple(map(int, version))
latest_intel = sorted((c for c in all_compilers if c.startswith("intel")), key=sort_key)[-1]
latest_gcc = sorted((c for c in all_compilers if c.startswith("gcc")), key=sort_key)[-1]
latest_intel = sorted((c for c in all_compilers if c.startswith("intel")), key=package_sort_key)[-1]
latest_gcc = sorted((c for c in all_compilers if c.startswith("gcc")), key=package_sort_key)[-1]
def enable(name):
if any(filtered_repo in name for filtered_repo in filter_repos):
......
......@@ -94,6 +94,12 @@ def do_mpcdf_refresh_aggregates(self, subcmd, opts, *args):
values = mpcdf_common.get_attribute_values(apiurl, project, None, attribute)
macros[target].append("%available_{0} {1}".format(name, ",".join(sorted(values))))
all_compilers = mpcdf_common.get_attribute_values(apiurl, project, None, "MPCDF:compiler_modules")
latest_intel = sorted((c for c in all_compilers if c.startswith("intel")), key=mpcdf_common.package_sort_key)[-1]
latest_gcc = sorted((c for c in all_compilers if c.startswith("gcc")), key=mpcdf_common.package_sort_key)[-1]
macros[target].append("%latest_intel " + latest_intel)
macros[target].append("%latest_gcc " + latest_gcc)
for repo in osc.core.get_repositories_of_project(apiurl, project):
aggregatename = "zz_aggregate_" + project.replace(":", "-") + "_" + repo
refresh_aggregate(aggregatename, project, repo, target)
......
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