1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-24 22:06:14 +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

View File

@ -323,11 +323,11 @@ apiurl = %(apiurl)s
# extra packages to install when building packages locally (osc build)
# this corresponds to osc build's -x option and can be overridden with that
# -x '' can also be given on the command line to override this setting, or
# you can have an empty setting here. This global setting may leads to
# you can have an empty setting here. This global setting may leads to
# dependency problems when the base distro is not providing the package.
# => using server side definition via cli_debug_packages substitute rule is
# recommended therefore.
#extra-pkgs =
#extra-pkgs =
# build platform is used if the platform argument is omitted to osc build
#build_repository = %(build_repository)s

View File

@ -1556,7 +1556,7 @@ class Package:
print('Transmitting file data', end=' ')
filelist = self.__generate_commitlist(todo_send)
sfilelist = self.__send_commitlog(msg, filelist, validate=True)
hash_entries = [e for e in sfilelist.findall('entry') if e.get('hash') is not None]
hash_entries = [e for e in sfilelist.findall('entry') if e.get('hash') is not None]
if sfilelist.get('error') and hash_entries:
name2elem = dict([(e.get('name'), e) for e in filelist.findall('entry')])
for entry in hash_entries:
@ -3746,7 +3746,7 @@ class metafile:
class _URLFactory:
# private class which might go away again...
def __init__(self, delegate, force_supported=True):
self._delegate = delegate
self._delegate = delegate
self._force_supported = force_supported
def is_force_supported(self):
@ -6047,7 +6047,7 @@ def get_package_results(apiurl, project, package=None, wait=False, *args, **kwar
if not wait or not waiting:
break
else:
yield xml
yield xml
yield xml

View File

@ -158,8 +158,8 @@ class PackageQueryResult:
epoch = self.epoch()
if epoch is not None and epoch != 0:
evr = epoch + b":" + evr
return evr
evr = epoch + b":" + evr
return evr
def cmp(a, b):