diff options
author | Ross Burton <ross.burton@intel.com> | 2016-01-25 15:08:23 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-01-26 22:31:09 +0000 |
commit | a13b0a0b79cf4db9f247facf71c03344b60be890 (patch) | |
tree | 1dd287cc6b3131c62683408dc910a87faeb3265f /meta/classes | |
parent | d986f90937b7b4c60128003ef5d30d01ac1653e3 (diff) | |
download | openembedded-core-a13b0a0b79cf4db9f247facf71c03344b60be890.tar.gz openembedded-core-a13b0a0b79cf4db9f247facf71c03344b60be890.tar.bz2 openembedded-core-a13b0a0b79cf4db9f247facf71c03344b60be890.zip |
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.
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/uninative.bbclass | 12 |
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() { loader = e.data.getVar("UNINATIVE_LOADER", True) tarball = d.getVar("UNINATIVE_TARBALL", True) tarballdir = d.getVar("UNINATIVE_DLDIR", True) + tarballpath = os.path.join(tarballdir, tarball) + if not os.path.exists(loader): import subprocess olddir = os.getcwd() - if not os.path.exists(os.path.join(tarballdir, tarball)): + if not os.path.exists(tarballpath): # Copy the data object and override DL_DIR and SRC_URI localdata = bb.data.createCopy(d) @@ -32,13 +34,15 @@ python uninative_eventhandler() { bb.fatal("Uninative selected but not configured correctly, please set UNINATIVE_CHECKSUM[%s]" % d.getVar("BUILD_ARCH", True)) srcuri = d.expand("${UNINATIVE_URL}${UNINATIVE_TARBALL};md5sum=%s" % chksum) - dldir = localdata.expand(tarballdir) - localdata.setVar('FILESPATH', dldir) - localdata.setVar('DL_DIR', dldir) + localdata.setVar('FILESPATH', tarballdir) + localdata.setVar('DL_DIR', tarballdir) bb.note("Fetching uninative binary shim from %s" % srcuri) fetcher = bb.fetch2.Fetch([srcuri], localdata, cache=False) try: fetcher.download() + localpath = fetcher.localpath(srcuri) + if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath): + os.symlink(localpath, tarballpath) except Exception as exc: bb.fatal("Unable to download uninative tarball: %s" % str(exc)) |