Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
db668300
Commit
db668300
authored
Sep 23, 2021
by
Lorenz Hüdepohl
Browse files
Do not make API call to update prj meta, if unchanged
parent
e4f1881f
Changes
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_common.py
View file @
db668300
...
...
@@ -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
=
()):
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment