mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-04 02:26:16 +01:00
Merge pull request #1043 from dirkmueller/download_url_quoting
Fix quoting of download urls
This commit is contained in:
commit
dec6f7135d
11
osc/build.py
11
osc/build.py
@ -188,12 +188,10 @@ class Buildinfo:
|
|||||||
self.pathes.append(node.get('project')+"/"+node.get('repository'))
|
self.pathes.append(node.get('project')+"/"+node.get('repository'))
|
||||||
# a hash providing the matching URL for specific repos for newer OBS instances
|
# a hash providing the matching URL for specific repos for newer OBS instances
|
||||||
if node.get('url'):
|
if node.get('url'):
|
||||||
url = node.get('url').replace('%', '%%')
|
baseurl = node.get('url').replace('%', '%%')
|
||||||
if config['api_host_options'][apiurl]['downloadurl']:
|
if config['api_host_options'][apiurl]['downloadurl']:
|
||||||
# Add the path element to the download url override.
|
# Add the path element to the download url override.
|
||||||
baseurl = config['api_host_options'][apiurl]['downloadurl'] + urlsplit(node.get('url'))[2]
|
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.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 ]
|
self.vminstall_list = [ dep.name for dep in self.deps if dep.vminstall ]
|
||||||
@ -295,14 +293,9 @@ class Pac:
|
|||||||
|
|
||||||
|
|
||||||
def makeurls(self, cachedir, urllist):
|
def makeurls(self, cachedir, urllist):
|
||||||
|
|
||||||
self.urllist = []
|
|
||||||
self.localdir = '%s/%s/%s/%s' % (cachedir, self.project, self.repository, self.arch)
|
self.localdir = '%s/%s/%s/%s' % (cachedir, self.project, self.repository, self.arch)
|
||||||
self.fullfilename = os.path.join(self.localdir, self.canonname)
|
self.fullfilename = os.path.join(self.localdir, self.canonname)
|
||||||
|
self.urllist = [url % self.mp for url in urllist]
|
||||||
# remote URLs
|
|
||||||
for url in urllist:
|
|
||||||
self.urllist.append(url % self.mp)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
@ -323,11 +323,11 @@ apiurl = %(apiurl)s
|
|||||||
# extra packages to install when building packages locally (osc build)
|
# extra packages to install when building packages locally (osc build)
|
||||||
# this corresponds to osc build's -x option and can be overridden with that
|
# 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
|
# -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.
|
# dependency problems when the base distro is not providing the package.
|
||||||
# => using server side definition via cli_debug_packages substitute rule is
|
# => using server side definition via cli_debug_packages substitute rule is
|
||||||
# recommended therefore.
|
# recommended therefore.
|
||||||
#extra-pkgs =
|
#extra-pkgs =
|
||||||
|
|
||||||
# build platform is used if the platform argument is omitted to osc build
|
# build platform is used if the platform argument is omitted to osc build
|
||||||
#build_repository = %(build_repository)s
|
#build_repository = %(build_repository)s
|
||||||
|
@ -1556,7 +1556,7 @@ class Package:
|
|||||||
print('Transmitting file data', end=' ')
|
print('Transmitting file data', end=' ')
|
||||||
filelist = self.__generate_commitlist(todo_send)
|
filelist = self.__generate_commitlist(todo_send)
|
||||||
sfilelist = self.__send_commitlog(msg, filelist, validate=True)
|
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:
|
if sfilelist.get('error') and hash_entries:
|
||||||
name2elem = dict([(e.get('name'), e) for e in filelist.findall('entry')])
|
name2elem = dict([(e.get('name'), e) for e in filelist.findall('entry')])
|
||||||
for entry in hash_entries:
|
for entry in hash_entries:
|
||||||
@ -3746,7 +3746,7 @@ class metafile:
|
|||||||
class _URLFactory:
|
class _URLFactory:
|
||||||
# private class which might go away again...
|
# private class which might go away again...
|
||||||
def __init__(self, delegate, force_supported=True):
|
def __init__(self, delegate, force_supported=True):
|
||||||
self._delegate = delegate
|
self._delegate = delegate
|
||||||
self._force_supported = force_supported
|
self._force_supported = force_supported
|
||||||
|
|
||||||
def is_force_supported(self):
|
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:
|
if not wait or not waiting:
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
yield xml
|
yield xml
|
||||||
yield xml
|
yield xml
|
||||||
|
|
||||||
|
|
||||||
|
@ -158,8 +158,8 @@ class PackageQueryResult:
|
|||||||
|
|
||||||
epoch = self.epoch()
|
epoch = self.epoch()
|
||||||
if epoch is not None and epoch != 0:
|
if epoch is not None and epoch != 0:
|
||||||
evr = epoch + b":" + evr
|
evr = epoch + b":" + evr
|
||||||
return evr
|
return evr
|
||||||
|
|
||||||
|
|
||||||
def cmp(a, b):
|
def cmp(a, b):
|
||||||
|
Loading…
Reference in New Issue
Block a user