summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2019-11-11 15:10:32 +1100
committerChris Johns <chrisj@rtems.org>2019-11-18 11:28:38 +1100
commit6950f2200707f43a8e1d22e0b20b9af5c8d8b637 (patch)
treedf764011baa4b5209c88d80155f65c52ccc88560
parentbfae21a67c0990a043bef2f9193d24b7d6b00cb1 (diff)
downloadrtems-source-builder-6950f2200707f43a8e1d22e0b20b9af5c8d8b637.tar.bz2
sb: Add support for a comma separated release path list.
Updates #3814
-rw-r--r--source-builder/sb/download.py32
-rw-r--r--source-builder/sb/version.py9
2 files changed, 22 insertions, 19 deletions
diff --git a/source-builder/sb/download.py b/source-builder/sb/download.py
index 1fb0155..e197879 100644
--- a/source-builder/sb/download.py
+++ b/source-builder/sb/download.py
@@ -599,16 +599,19 @@ def get_file(url, local, opts, config):
raise error.general('source not found: %s' % (path.host(local)))
#
# Check if a URL has been provided on the command line. If the package is
- # released push to the start the RTEMS URL unless overrided by the command
- # line option --with-release-url. The variant --without-release-url can
- # override the released check.
+ # released push the release path URLs to the start the RTEMS URL list
+ # unless overriden by the command line option --without-release-url. The
+ # variant --without-release-url can override the released check.
#
url_bases = opts.urls()
+ if url_bases is None:
+ url_bases = []
try:
rtems_release_url_value = config.macros.expand('%{release_path}')
except:
rtems_release_url_value = None
rtems_release_url = None
+ rtems_release_urls = []
if version.released() and rtems_release_url_value:
rtems_release_url = rtems_release_url_value
with_rel_url = opts.with_arg('release-url')
@@ -627,18 +630,17 @@ def get_file(url, local, opts, config):
elif with_rel_url[0] == 'without_release-url' and with_rel_url[1] == 'yes':
rtems_release_url = None
if rtems_release_url is not None:
- log.trace('release url: %s' % (rtems_release_url))
- #
- # If the URL being fetched is under the release path do not add the
- # sources release path because it is already there.
- #
- if not url.startswith(rtems_release_url):
- if url_bases is None:
- url_bases = [rtems_release_url]
- else:
- url_bases.append(rtems_release_url)
+ rtems_release_urls = rtems_release_url.split(',')
+ for release_url in rtems_release_urls:
+ log.trace('release url: %s' % (release_url))
+ #
+ # If the URL being fetched is under the release path do not add
+ # the sources release path because it is already there.
+ #
+ if not url.startswith(release_url):
+ url_bases = [release_url] + url_bases
urls = []
- if url_bases is not None:
+ if len(url_bases) > 0:
#
# Split up the URL we are being asked to download.
#
@@ -654,7 +656,7 @@ def get_file(url, local, opts, config):
# Hack to fix #3064 where --rsb-file is being used. This code is a
# mess and should be refactored.
#
- if version.released() and base == rtems_release_url:
+ if version.released() and base in rtems_release_urls:
url_file = path.basename(local)
if base[-1:] != '/':
base += '/'
diff --git a/source-builder/sb/version.py b/source-builder/sb/version.py
index 0148614..34fb421 100644
--- a/source-builder/sb/version.py
+++ b/source-builder/sb/version.py
@@ -112,15 +112,16 @@ def load_release_settings(macros):
hashes = v.items('hashes')
except:
hashes = []
- try:
- release_path = v.get('version', 'release_path', raw = True)
- except:
- release_path = None
for hash in hashes:
hs = hash[1].split()
if len(hs) != 2:
raise error.general('invalid release hash in VERSION')
sources.hash((hs[0], hash[0], hs[1]), macros, setting_error)
+ try:
+ release_path = v.get('version', 'release_path', raw = True)
+ release_path = ','.join([rp.strip() for rp in release_path.split(',')])
+ except:
+ release_path = None
download.set_release_path(release_path, macros)
def version():