diff options
Diffstat (limited to 'meta/classes/archiver.bbclass')
-rw-r--r-- | meta/classes/archiver.bbclass | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass index 5f9c91d2f8..1d8e863bdc 100644 --- a/meta/classes/archiver.bbclass +++ b/meta/classes/archiver.bbclass | |||
@@ -151,6 +151,7 @@ python do_ar_original() { | |||
151 | encoded = bb.fetch2.encodeurl(decoded) | 151 | encoded = bb.fetch2.encodeurl(decoded) |
152 | urls[i] = encoded | 152 | urls[i] = encoded |
153 | fetch = bb.fetch2.Fetch(urls, d) | 153 | fetch = bb.fetch2.Fetch(urls, d) |
154 | tarball_suffix = {} | ||
154 | for url in fetch.urls: | 155 | for url in fetch.urls: |
155 | local = fetch.localpath(url).rstrip("/"); | 156 | local = fetch.localpath(url).rstrip("/"); |
156 | if os.path.isfile(local): | 157 | if os.path.isfile(local): |
@@ -158,7 +159,21 @@ python do_ar_original() { | |||
158 | elif os.path.isdir(local): | 159 | elif os.path.isdir(local): |
159 | tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True)) | 160 | tmpdir = tempfile.mkdtemp(dir=d.getVar('ARCHIVER_WORKDIR', True)) |
160 | fetch.unpack(tmpdir, (url,)) | 161 | fetch.unpack(tmpdir, (url,)) |
161 | create_tarball(d, tmpdir + '/.', '', ar_outdir) | 162 | # To handle recipes with more than one source, we add the "name" |
163 | # URL parameter as suffix. We treat it as an error when | ||
164 | # there's more than one URL without a name, or a name gets reused. | ||
165 | # This is an additional safety net, in practice the name has | ||
166 | # to be set when using the git fetcher, otherwise SRCREV cannot | ||
167 | # be set separately for each URL. | ||
168 | params = bb.fetch2.decodeurl(url)[5] | ||
169 | name = params.get('name', '') | ||
170 | if name in tarball_suffix: | ||
171 | if not name: | ||
172 | bb.fatal("Cannot determine archive names for original source because 'name' URL parameter is unset in more than one URL. Add it to at least one of these: %s %s" % (tarball_suffix[name], url)) | ||
173 | else: | ||
174 | bb.fatal("Cannot determine archive names for original source because 'name=' URL parameter '%s' is used twice. Make it unique in: %s %s" % (tarball_suffix[name], url)) | ||
175 | tarball_suffix[name] = url | ||
176 | create_tarball(d, tmpdir + '/.', name, ar_outdir) | ||
162 | 177 | ||
163 | # Emit patch series files for 'original' | 178 | # Emit patch series files for 'original' |
164 | bb.note('Writing patch series files...') | 179 | bb.note('Writing patch series files...') |