[oe-commits] Markus Lehtonen : devtool: slight simplification of path splitting logic

git at git.openembedded.org git at git.openembedded.org
Thu Jun 18 08:16:44 UTC 2015


Module: openembedded-core.git
Branch: master
Commit: 762ca3e8d78d4dd22f7be045082052ad20b71e50
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=762ca3e8d78d4dd22f7be045082052ad20b71e50

Author: Markus Lehtonen <markus.lehtonen at linux.intel.com>
Date:   Thu May 28 16:00:52 2015 +0300

devtool: slight simplification of path splitting logic

Signed-off-by: Markus Lehtonen <markus.lehtonen at linux.intel.com>

---

 scripts/lib/devtool/standard.py | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 4b9cebb..c92c9ae 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -464,13 +464,12 @@ def modify(args, config, basepath, workspace):
                 initial_rev = stdout.rstrip()
 
     # Check that recipe isn't using a shared workdir
-    s = rd.getVar('S', True)
-    workdir = rd.getVar('WORKDIR', True)
-    if s.startswith(workdir):
+    s = os.path.abspath(rd.getVar('S', True))
+    workdir = os.path.abspath(rd.getVar('WORKDIR', True))
+    if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
         # Handle if S is set to a subdirectory of the source
-        if s != workdir and os.path.dirname(s) != workdir:
-            srcsubdir = os.sep.join(os.path.relpath(s, workdir).split(os.sep)[1:])
-            srctree = os.path.join(srctree, srcsubdir)
+        srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
+        srctree = os.path.join(srctree, srcsubdir)
 
     appendpath = os.path.join(config.workspace_path, 'appends')
     if not os.path.exists(appendpath):



More information about the Openembedded-commits mailing list