[oe-commits] Paul Eggleton : devtool: modify: handle recipes that use a shared workdir

git at git.openembedded.org git at git.openembedded.org
Thu Feb 19 23:16:46 UTC 2015


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

Author: Paul Eggleton <paul.eggleton at linux.intel.com>
Date:   Thu Feb 19 16:40:02 2015 +0000

devtool: modify: handle recipes that use a shared workdir

If S is outside of WORKDIR then we shouldn't try to get the relative
path in order to work out where the source subdirectory is as we do by
default.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie at linuxfoundation.org>

---

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

diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 9ab3aa6..4cb03f3 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -313,12 +313,14 @@ def modify(args, config, basepath, workspace):
             (stdout, _) = bb.process.run('git rev-parse HEAD', cwd=args.srctree)
             initial_rev = stdout.rstrip()
 
-    # Handle if S is set to a subdirectory of the source
+    # Check that recipe isn't using a shared workdir
     s = rd.getVar('S', True)
     workdir = rd.getVar('WORKDIR', True)
-    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)
+    if s.startswith(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)
 
     appendpath = os.path.join(config.workspace_path, 'appends')
     if not os.path.exists(appendpath):



More information about the Openembedded-commits mailing list