summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@intel.com>2016-01-25 15:08:23 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-01-26 22:31:58 +0000
commitcac47db9c5d66801107e42462f2e5a8e4dc4724b (patch)
tree1058af6a012f4876639260a3ea8be5f991add8cf /meta
parent99958140a2d73cd580c711ce74070d9d42ffe2fb (diff)
downloadpoky-cac47db9c5d66801107e42462f2e5a8e4dc4724b.tar.gz
uninative: handle UNINATIVE_URL being file:///
If the local fetcher is used then files are not actually fetched into DL_DIR, so check if this happened and if required add a symlink to the real file. (From OE-Core rev: a13b0a0b79cf4db9f247facf71c03344b60be890) Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/uninative.bbclass12
1 files changed, 8 insertions, 4 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index 3383e01cda..38c05dfc0a 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -16,11 +16,13 @@ python uninative_eventhandler() {
16 loader = e.data.getVar("UNINATIVE_LOADER", True) 16 loader = e.data.getVar("UNINATIVE_LOADER", True)
17 tarball = d.getVar("UNINATIVE_TARBALL", True) 17 tarball = d.getVar("UNINATIVE_TARBALL", True)
18 tarballdir = d.getVar("UNINATIVE_DLDIR", True) 18 tarballdir = d.getVar("UNINATIVE_DLDIR", True)
19 tarballpath = os.path.join(tarballdir, tarball)
20
19 if not os.path.exists(loader): 21 if not os.path.exists(loader):
20 import subprocess 22 import subprocess
21 23
22 olddir = os.getcwd() 24 olddir = os.getcwd()
23 if not os.path.exists(os.path.join(tarballdir, tarball)): 25 if not os.path.exists(tarballpath):
24 # Copy the data object and override DL_DIR and SRC_URI 26 # Copy the data object and override DL_DIR and SRC_URI
25 localdata = bb.data.createCopy(d) 27 localdata = bb.data.createCopy(d)
26 28
@@ -32,13 +34,15 @@ python uninative_eventhandler() {
32 bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH", True)) 34 bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH", True))
33 35
34 srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};md5sum=%s" % chksum) 36 srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};md5sum=%s" % chksum)
35 dldir = localdata.expand(tarballdir) 37 localdata.setVar('FILESPATH', tarballdir)
36 localdata.setVar('FILESPATH', dldir) 38 localdata.setVar('DL_DIR', tarballdir)
37 localdata.setVar('DL_DIR', dldir)
38 bb.note("Fetching uninative binary shim from %s" % srcuri) 39 bb.note("Fetching uninative binary shim from %s" % srcuri)
39 fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) 40 fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False)
40 try: 41 try:
41 fetcher.download() 42 fetcher.download()
43 localpath = fetcher.localpath(srcuri)
44 if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
45 os.symlink(localpath, tarballpath)
42 except Exception as exc: 46 except Exception as exc:
43 bb.fatal("Unable to download uninative tarball: %s" % str(exc)) 47 bb.fatal("Unable to download uninative tarball: %s" % str(exc))
44 48