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

Make generated pkg meta more similar to existing

This often avoids making an API call to the server completely, if the
generated XML can be shown to be the same as the existing.
parent ea456635
Pipeline #71890 passed with stage
in 13 seconds
......@@ -415,6 +415,8 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, dry_run=
for enable in build.findall("./enable"):
build.remove(enable)
disabled_repos = {disable.get("repository") for disable in build.findall("./disable")}
try:
enable_repos = get_attribute_values(api_url, project, package, "MPCDF:enable_repositories")
except Exception:
......@@ -443,13 +445,15 @@ def mpcdf_enable_repositories(api_url, project, package, verbose=False, dry_run=
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]
i = len(build)
def enable(name):
if name in ignore_repos:
if name in ignore_repos or name in disabled_repos:
return
node = ElementTree.Element("enable")
node.set("repository", name)
node.tail = "\n "
build.insert(0, node)
build.insert(i, node)
if verbose:
print("Enabling", name)
......
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