1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-09 22:36:14 +01:00

Merge pull request #980 from marcus-h/escape_binary_download_urls

Escape % character in binary download URLs
This commit is contained in:
Marco Strigl 2021-12-08 11:42:03 +01:00 committed by GitHub
commit 6c89e4eb5c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,7 +180,8 @@ class Buildinfo:
self.pathes.append(node.get('project')+"/"+node.get('repository'))
# a hash providing the matching URL for specific repos for newer OBS instances
if node.get('url'):
self.urls[node.get('project')+"/"+node.get('repository')] = node.get('url') + '/%(arch)s/%(filename)s'
url = node.get('url').replace('%', '%%')
self.urls[node.get('project')+"/"+node.get('repository')] = url + '/%(arch)s/%(filename)s'
self.vminstall_list = [ dep.name for dep in self.deps if dep.vminstall ]
self.preinstall_list = [ dep.name for dep in self.deps if dep.preinstall ]
@ -1044,7 +1045,7 @@ def main(apiurl, opts, argv):
# we have now specific download repositories per repository. Could be removed IMHO, since the api fallback
# is there. In worst case it could fetch the wrong rpm...
if bi.downloadurl:
urllist.append(bi.downloadurl + '/%(extproject)s/%(extrepository)s/%(arch)s/%(filename)s')
urllist.append(bi.downloadurl.replace('%', '%%') + '/%(extproject)s/%(extrepository)s/%(arch)s/%(filename)s')
if opts.disable_cpio_bulk_download:
urllist.append( '%(apiurl)s/build/%(project)s/%(repository)s/%(repoarch)s/%(repopackage)s/%(repofilename)s' )