Hi Paul,

On 5/20/20 7:26 PM, Paul Barker wrote:
On Wed, 20 May 2020 at 11:00, Robert Yang <[email protected]> wrote:

Hi Bruce,

Please ignore this patch, I found more recipes in meta-virt have this issue, we 
need fix all of them or find a better solutions.

I think the issue should probably be logged against the archiver
itself in the Yocto bugzilla. If the archiver is changing SRC_URI it
should handle any consequences, not require recipes to adapt for it.

Seems that I've figured the problem, do_ar_original has copy SRC_URI into
the variable urls, then when call fetch = bb.fetch2.Fetch(urls, d), there
would be duplicated urls as the error reported:

    
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.

Here is the patch, I appreciate it if you can help to review before I send it to
oe-core mailing list.

diff --git a/meta/classes/archiver.bbclass b/meta/classes/archiver.bbclass
index 817b91207f..73d5aa7787 100644
--- a/meta/classes/archiver.bbclass
+++ b/meta/classes/archiver.bbclass
@@ -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("/");


// Robert





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#5332): 
https://lists.yoctoproject.org/g/meta-virtualization/message/5332
Mute This Topic: https://lists.yoctoproject.org/mt/74345499/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/meta-virtualization/unsub  
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to