summaryrefslogtreecommitdiffstats
path: root/meta/classes/uninative.bbclass
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-06 21:34:21 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-08 09:17:49 +0100
commit917032944ec71e62ba9e32842ec78e1d1218e2e0 (patch)
tree7256048e10d1f4b4e33dbeb79738cc8fcd33e6ce /meta/classes/uninative.bbclass
parent26499d1b08448a72a6530b35966c134ea88765ee (diff)
downloadpoky-917032944ec71e62ba9e32842ec78e1d1218e2e0.tar.gz
uninative: Handle PREMIRRORS generically
Currently uninative handles SOURCE_MIRROR_URL but not generic PREMIRRORS. It can handle this better, attempt to iterate PREMIRRORS entries. (From OE-Core rev: 6426c952b5ade48ea94fb647efc464e603989b97) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/uninative.bbclass')
-rw-r--r--meta/classes/uninative.bbclass13
1 files changed, 9 insertions, 4 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 70799bbf6d..316c0f0616 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -56,12 +56,17 @@ python uninative_event_fetchloader() {
56 # Our games with path manipulation of DL_DIR mean standard PREMIRRORS don't work 56 # Our games with path manipulation of DL_DIR mean standard PREMIRRORS don't work
57 # and we can't easily put 'chksum' into the url path from a url parameter with 57 # and we can't easily put 'chksum' into the url path from a url parameter with
58 # the current fetcher url handling 58 # the current fetcher url handling
59 ownmirror = d.getVar('SOURCE_MIRROR_URL') 59 premirrors = bb.fetch2.mirror_from_string(localdata.getVar("PREMIRRORS"))
60 if ownmirror: 60 for line in premirrors:
61 localdata.appendVar("PREMIRRORS", " ${UNINATIVE_URL}${UNINATIVE_TARBALL} ${SOURCE_MIRROR_URL}/uninative/%s/${UNINATIVE_TARBALL}" % chksum) 61 try:
62 (find, replace) = line
63 except ValueError:
64 continue
65 if find.startswith("http"):
66 localdata.appendVar("PREMIRRORS", " ${UNINATIVE_URL}${UNINATIVE_TARBALL} %s/uninative/%s/${UNINATIVE_TARBALL}" % (replace, chksum))
62 67
63 srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};sha256sum=%s" % chksum) 68 srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};sha256sum=%s" % chksum)
64 bb.note("Fetching uninative binary shim from %s" % srcuri) 69 bb.note("Fetching uninative binary shim %s (will check PREMIRRORS first)" % srcuri)
65 70
66 fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) 71 fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
67 fetcher.download() 72 fetcher.download()