summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorMark Hatle <mark.hatle@windriver.com>2018-01-23 14:56:18 -0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-01-29 08:45:28 +0000
commit04395b3336e89169ef0c8c160dea8ab72090f57a (patch)
tree417ef4bd3de169c3ff0b1a63aceaaf4a3719b174 /meta
parent014afe7666f7ffc8a8d3d719a5fe7b23523a81fe (diff)
downloadpoky-04395b3336e89169ef0c8c160dea8ab72090f57a.tar.gz
uninative.bbclass: Fix broken symlink issue
If two builds are sharing the same DL_DIR, and the uninative file is local to a layer. When the first build gets to uninative it creates the link local to itself, and subsequent users can use the same link. However if that first build then is deleted from the disk, the symlink is no longer valid (broken). We need to update the system to detect this case, and use the model implemented by the bitbke fetch2 code. Look for a broken link, remove it, then try to create the link and ignore an exception if it already exists (since we just unlinked any bad one). (From OE-Core rev: 32895152580152c6613a4d651ba1bcee9be9883f) Signed-off-by: Mark Hatle <mark.hatle@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit bfd9664edad7044b5da53fc33b8d0f6508f00950) Signed-off-by: Otavio Salvador <otavio@ossystems.com.br> Signed-off-by: Armin Kuster <akuster808@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/uninative.bbclass12
1 files changed, 12 insertions, 0 deletions
diff --git a/meta/classes/uninative.bbclass b/meta/classes/uninative.bbclass
index a410647328..670efa9f05 100644
--- a/meta/classes/uninative.bbclass
+++ b/meta/classes/uninative.bbclass
@@ -63,7 +63,19 @@ python uninative_event_fetchloader() {
63 fetcher.download() 63 fetcher.download()
64 localpath = fetcher.localpath(srcuri) 64 localpath = fetcher.localpath(srcuri)
65 if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath): 65 if localpath != tarballpath and os.path.exists(localpath) and not os.path.exists(tarballpath):
66 # Follow the symlink behavior from the bitbake fetch2.
67 # This will cover the case where an existing symlink is broken
68 # as well as if there are two processes trying to create it
69 # at the same time.
70 if os.path.islink(tarballpath):
71 # Broken symbolic link
72 os.unlink(tarballpath)
73
74 # Deal with two processes trying to make symlink at once
75 try:
66 os.symlink(localpath, tarballpath) 76 os.symlink(localpath, tarballpath)
77 except FileExistsError:
78 pass
67 79
68 cmd = d.expand("\ 80 cmd = d.expand("\
69mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; \ 81mkdir -p ${UNINATIVE_STAGING_DIR}-uninative; \