]> code.ossystems Code Review - openembedded-core.git/commitdiff
archiver.bbclass: Fix duplicated SRC_URIs for do_ar_original
authorRobert Yang <liezhi.yang@windriver.com>
Thu, 21 May 2020 04:05:56 +0000 (21:05 -0700)
committerSteve Sakoman <steve@sakoman.com>
Tue, 26 May 2020 16:49:56 +0000 (06:49 -1000)
The argument urls of bb.fetch2.Fetch(urls, d) are duplicated to SRC_URI, which caused errors like:

bb.data_smart.ExpansionError: Failure expanding variable SRCPV, expression was ${@bb.fetch2.get_srcrev(d)} which triggered exception FetchError: Fetcher failure: The SRCREV_FORMAT variable must be set when multiple SCMs are used.
The SCMs are:
git://github.com/docker/notary.git;destsuffix=git/src/github.com/docker/notary
git://github.com/docker/notary.git

The first one is from original SRC_URI, the second one is from the
variable 'urls', so cleanup SRC_URI before call bb.fetch2.Fetch() can fix the
problem.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit b244c4f3427cd07376d4b8f7d27e38735bcc90e7)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/classes/archiver.bbclass

index 43333a7551ade481c74c35187ddd3ffe74f96d10..780c562b689c804996fe5efeec9c06e9e0821975 100644 (file)
@@ -193,7 +193,13 @@ python do_ar_original() {
                 del decoded[5][param]
         encoded = bb.fetch2.encodeurl(decoded)
         urls[i] = encoded
-    fetch = bb.fetch2.Fetch(urls, d)
+
+    # Cleanup SRC_URI before call bb.fetch2.Fetch() since now SRC_URI is in the
+    # variable "urls", otherwise there might be errors like:
+    # The SRCREV_FORMAT variable must be set when multiple SCMs are used
+    ld = bb.data.createCopy(d)
+    ld.setVar('SRC_URI', '')
+    fetch = bb.fetch2.Fetch(urls, ld)
     tarball_suffix = {}
     for url in fetch.urls:
         local = fetch.localpath(url).rstrip("/");