1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-26 06:46:13 +01:00

Merge pull request #1043 from dirkmueller/download_url_quoting

Fix quoting of download urls
This commit is contained in:
Daniel Mach 2022-06-02 13:28:59 +02:00 committed by GitHub
commit dec6f7135d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 16 deletions

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 ]
@ -295,14 +293,9 @@ class Pac:
def makeurls(self, cachedir, urllist):
self.urllist = []
self.localdir = '%s/%s/%s/%s' % (cachedir, self.project, self.repository, self.arch)
self.fullfilename = os.path.join(self.localdir, self.canonname)
# remote URLs
for url in urllist:
self.urllist.append(url % self.mp)
self.urllist = [url % self.mp for url in urllist]
def __str__(self):
return self.name