1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 09:16:16 +02:00

use percent-quoted url for download url generation

We need to percent-quote base urls because they will
be used in named-percent-substitution afterwards.
This commit is contained in:
Dirk Müller 2022-05-20 11:53:19 +02:00
parent 754af85423
commit 8ba078a872
No known key found for this signature in database

View File

@ -188,12 +188,10 @@ 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'):
url = node.get('url').replace('%', '%%')
baseurl = node.get('url').replace('%', '%%')
if config['api_host_options'][apiurl]['downloadurl']:
# Add the path element to the download url override.
baseurl = config['api_host_options'][apiurl]['downloadurl'] + urlsplit(node.get('url'))[2]
else:
baseurl = node.get('url')
self.urls[node.get('project')+"/"+node.get('repository')] = baseurl + '/%(arch)s/%(filename)s'
self.vminstall_list = [ dep.name for dep in self.deps if dep.vminstall ]