mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-09 12:35:48 +01:00
detachbranch: remove _link when link target got removed
This commit is contained in:
parent
5fdcecfbab
commit
f98083df5c
@ -2855,7 +2855,14 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
li = Linkinfo()
|
li = Linkinfo()
|
||||||
li.read(root.find('linkinfo'))
|
li.read(root.find('linkinfo'))
|
||||||
if li.islink() and li.haserror():
|
if li.islink() and li.haserror():
|
||||||
raise oscerr.LinkExpandError(project, package, li.error)
|
try:
|
||||||
|
show_package_meta(apiurl, li.project, li.package)
|
||||||
|
except HTTPError as e:
|
||||||
|
if e.code == 404:
|
||||||
|
print("Link target got removed, dropping link. WARNING: latest submissions in link target might be lost!")
|
||||||
|
delete_files(apiurl, project, package, ['_link'])
|
||||||
|
else:
|
||||||
|
raise oscerr.LinkExpandError(project, package, li.error)
|
||||||
elif not li.islink():
|
elif not li.islink():
|
||||||
print('package \'%s/%s\' is no link' % (project, package), file=sys.stderr)
|
print('package \'%s/%s\' is no link' % (project, package), file=sys.stderr)
|
||||||
else:
|
else:
|
||||||
|
@ -540,7 +540,7 @@ class Linkinfo:
|
|||||||
|
|
||||||
def islink(self):
|
def islink(self):
|
||||||
"""returns True if the linkinfo is not empty, otherwise False"""
|
"""returns True if the linkinfo is not empty, otherwise False"""
|
||||||
if self.xsrcmd5 or self.lsrcmd5:
|
if self.xsrcmd5 or self.lsrcmd5 or self.error is not None:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user