mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-25 01:16:14 +01:00
- fix setlinkrev for current revision when link target is on remote OBS instance
This commit is contained in:
parent
4f8bedf998
commit
ab0e5d43ce
18
osc/core.py
18
osc/core.py
@ -3305,8 +3305,8 @@ def show_upstream_xsrcmd5(apiurl, prj, pac, revision=None, linkrev=None, linkrep
|
|||||||
return li.xsrcmd5
|
return li.xsrcmd5
|
||||||
|
|
||||||
|
|
||||||
def show_upstream_rev(apiurl, prj, pac, meta=False):
|
def show_upstream_rev(apiurl, prj, pac, revision=None, expand=False, linkrev=None, meta=False):
|
||||||
m = show_files_meta(apiurl, prj, pac, meta=meta)
|
m = show_files_meta(apiurl, prj, pac, revision=revision, expand=expand, linkrev=linkrev, meta=meta)
|
||||||
return ET.fromstring(''.join(m)).get('rev')
|
return ET.fromstring(''.join(m)).get('rev')
|
||||||
|
|
||||||
|
|
||||||
@ -5470,15 +5470,21 @@ def set_link_rev(apiurl, project, package, revision='', xsrcmd5=False, baserev=F
|
|||||||
# set revision element
|
# set revision element
|
||||||
src_project = root.get('project', project)
|
src_project = root.get('project', project)
|
||||||
src_package = root.get('package')
|
src_package = root.get('package')
|
||||||
|
if src_project == None:
|
||||||
|
src_project = project
|
||||||
|
if src_package == None:
|
||||||
|
src_package = package
|
||||||
|
linkrev=None
|
||||||
|
if baserev:
|
||||||
|
linkrev='base'
|
||||||
if revision is None:
|
if revision is None:
|
||||||
if 'rev' in root.keys():
|
if 'rev' in root.keys():
|
||||||
del root.attrib['rev']
|
del root.attrib['rev']
|
||||||
elif baserev:
|
|
||||||
revision = show_upstream_xsrcmd5(apiurl, src_project, src_package, linkrev='base')
|
|
||||||
elif xsrcmd5:
|
elif xsrcmd5:
|
||||||
revision = show_upstream_xsrcmd5(apiurl, src_project, src_package)
|
# don't use xsrcmd5 sum, because packages with links on remote instance do not have a linkinfo
|
||||||
|
revision = show_upstream_rev(apiurl, src_project, src_package, expand=True, linkrev=linkrev)
|
||||||
elif revision == '':
|
elif revision == '':
|
||||||
revision = show_upstream_rev(apiurl, src_project, src_package)
|
revision = show_upstream_rev(apiurl, src_project, src_package, linkrev=linkrev)
|
||||||
|
|
||||||
if revision:
|
if revision:
|
||||||
root.set('rev', revision)
|
root.set('rev', revision)
|
||||||
|
Loading…
Reference in New Issue
Block a user