summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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