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

Do not make API call to update prj meta, if unchanged

parent e4f1881f
......@@ -887,6 +887,10 @@ Macros:
new_prjconf = "".join(prjconf_head) + "\n".join(prjconf_ours) + "".join(prjconf_tail)
old_prj_root = project_meta(api_url, project)
sort_repos(old_prj_root)
old_prj = ElementTree.tostring(old_prj_root, encoding=osc.core.ET_ENCODING)
if diff:
def stringdiff(s1, label1, s2, label2):
import os
......@@ -906,11 +910,6 @@ Macros:
os.unlink(new.name)
stringdiff("".join(orig_prjconf), "old-prjconf", new_prjconf, "new-prjconf")
old_prj_root = project_meta(api_url, project)
sort_repos(old_prj_root)
old_prj = ElementTree.tostring(old_prj_root, encoding=osc.core.ET_ENCODING)
stringdiff(old_prj + "\n", "old-prj-meta", new_prj + "\n", "new-prj-meta")
if dry_run:
......@@ -931,8 +930,11 @@ Macros:
mpcdf_enable_repositories_for_all_packages(api_url, project)
# Update repositories
print("Updating prj meta")
osc.core.edit_meta("prj", project, data=new_prj, force=True, apiurl=api_url)
if new_prj == old_prj:
print("prj meta unchanged")
else:
print("Updating prj meta")
osc.core.edit_meta("prj", project, data=new_prj, force=True, apiurl=api_url)
def mpcdf_enable_repositories_for_all_packages(api_url, project, ignore_repos=()):
......
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