1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 18:26:15 +01:00

be sure that destination is not existing before overwriting content

we used to crash on utf encoding errors, be sure not to replace meta
data in that case
This commit is contained in:
Adrian Schröter 2019-10-08 17:55:37 +02:00
parent d2de7ccc97
commit e2c50fb8c1

View File

@ -5145,9 +5145,10 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='',
if root.get('project') != dst_project:
# The source comes from a different project via a project link, we need to create this instance
meta_change = True
except:
except HTTPError as e:
if e.code != 404:
raise
meta_change = True
if meta_change:
if missing_target:
dst_meta = '<package name="%s"><title/><description/></package>' % dst_package
@ -5239,7 +5240,9 @@ def aggregate_pac(src_project, src_package, dst_project, dst_package, repo_map =
if root.get('project') != dst_project:
# The source comes from a different project via a project link, we need to create this instance
meta_change = True
except:
except HTTPError as e:
if e.code != 404:
raise
meta_change = True
if meta_change: