mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-09 22:36:14 +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.read(root.find('linkinfo'))
|
||||
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():
|
||||
print('package \'%s/%s\' is no link' % (project, package), file=sys.stderr)
|
||||
else:
|
||||
|
@ -540,7 +540,7 @@ class Linkinfo:
|
||||
|
||||
def islink(self):
|
||||
"""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 False
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user