On Thu, 2020-08-06 at 11:05 -0700, Scott Branden wrote:
> We found the source of the uninative fetch problem:
> 
> SOURCE_MIRROR_URL needs to be set in order for uninative to be picked
> up from local mirror.
> 
> The standard PREMIRRORS mechanism doesn't work for this single
> tarball.
> So every time a clean poky build took place it always went to the
> internet to fetch the uninative tarball
> the first time and store it in the local build download.
> 
> I think this should be clearly documented somewhere in the yocto
> manual?

That definitely explains things. I think its assumed that people would
set appropriate PREMIRRORS to cover uninative in this case but that
isn't documented. I'm not even sure we want for people to have to care
about this :/.

Can you try this change:

diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 70799bbf6d..99072e1326 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -56,9 +56,14 @@ python uninative_event_fetchloader() {
             # Our games with path manipulation of DL_DIR mean standard 
PREMIRRORS don't work
             # and we can't easily put 'chksum' into the url path from a url 
parameter with
             # the current fetcher url handling
-            ownmirror = d.getVar('SOURCE_MIRROR_URL')
-            if ownmirror:
-                localdata.appendVar("PREMIRRORS", " 
${UNINATIVE_URL}${UNINATIVE_TARBALL} 
${SOURCE_MIRROR_URL}/uninative/%s/${UNINATIVE_TARBALL}" % chksum)
+            premirrors = 
bb.fetch2.mirror_from_string(localdata.getVar("PREMIRRORS"))
+            for line in premirrors:
+                try:
+                    (find, replace) = line
+                except ValueError:
+                    continue
+                if find.startswith("http"):
+                    localdata.appendVar("PREMIRRORS", " 
${UNINATIVE_URL}${UNINATIVE_TARBALL} %s/uninative/%s/${UNINATIVE_TARBALL}" % 
(replace, chksum))
 
             srcuri = 
d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};sha256sum=%s" % chksum)
             bb.note("Fetching uninative binary shim from %s" % srcuri)

Hopefully that handles this case more generically.

Cheers,
Richard
 



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

View/Reply Online (#50231): https://lists.yoctoproject.org/g/yocto/message/50231
Mute This Topic: https://lists.yoctoproject.org/mt/74157229/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to