1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 00:20:08 +00:00

devtool: slight simplification of path splitting logic

(From OE-Core rev: 762ca3e8d78d4dd22f7be045082052ad20b71e50)

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Markus Lehtonen
2015-05-28 16:00:52 +03:00
committed by Richard Purdie
parent 962f8a499e
commit f5ea48cb12
+5 -6
View File
@@ -464,13 +464,12 @@ def modify(args, config, basepath, workspace):
initial_rev = stdout.rstrip() initial_rev = stdout.rstrip()
# Check that recipe isn't using a shared workdir # Check that recipe isn't using a shared workdir
s = rd.getVar('S', True) s = os.path.abspath(rd.getVar('S', True))
workdir = rd.getVar('WORKDIR', True) workdir = os.path.abspath(rd.getVar('WORKDIR', True))
if s.startswith(workdir): if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
# Handle if S is set to a subdirectory of the source # Handle if S is set to a subdirectory of the source
if s != workdir and os.path.dirname(s) != workdir: srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
srcsubdir = os.sep.join(os.path.relpath(s, workdir).split(os.sep)[1:]) srctree = os.path.join(srctree, srcsubdir)
srctree = os.path.join(srctree, srcsubdir)
appendpath = os.path.join(config.workspace_path, 'appends') appendpath = os.path.join(config.workspace_path, 'appends')
if not os.path.exists(appendpath): if not os.path.exists(appendpath):