summaryrefslogtreecommitdiffstats
path: root/scripts/lib/devtool/standard.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/devtool/standard.py')
-rw-r--r--scripts/lib/devtool/standard.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index e3b74ab8f0..f46ce34ad1 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -765,6 +765,16 @@ def get_staging_kbranch(srcdir):
765 staging_kbranch = "".join(branch.split('\n')[0]) 765 staging_kbranch = "".join(branch.split('\n')[0])
766 return staging_kbranch 766 return staging_kbranch
767 767
768def get_real_srctree(srctree, s, workdir):
769 # Check that recipe isn't using a shared workdir
770 s = os.path.abspath(s)
771 workdir = os.path.abspath(workdir)
772 if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
773 # Handle if S is set to a subdirectory of the source
774 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
775 srctree = os.path.join(srctree, srcsubdir)
776 return srctree
777
768def modify(args, config, basepath, workspace): 778def modify(args, config, basepath, workspace):
769 """Entry point for the devtool 'modify' subcommand""" 779 """Entry point for the devtool 'modify' subcommand"""
770 import bb 780 import bb
@@ -923,14 +933,7 @@ def modify(args, config, basepath, workspace):
923 933
924 # Need to grab this here in case the source is within a subdirectory 934 # Need to grab this here in case the source is within a subdirectory
925 srctreebase = srctree 935 srctreebase = srctree
926 936 srctree = get_real_srctree(srctree, rd.getVar('S'), rd.getVar('WORKDIR'))
927 # Check that recipe isn't using a shared workdir
928 s = os.path.abspath(rd.getVar('S'))
929 workdir = os.path.abspath(rd.getVar('WORKDIR'))
930 if s.startswith(workdir) and s != workdir and os.path.dirname(s) != workdir:
931 # Handle if S is set to a subdirectory of the source
932 srcsubdir = os.path.relpath(s, workdir).split(os.sep, 1)[1]
933 srctree = os.path.join(srctree, srcsubdir)
934 937
935 bb.utils.mkdirhier(os.path.dirname(appendfile)) 938 bb.utils.mkdirhier(os.path.dirname(appendfile))
936 with open(appendfile, 'w') as f: 939 with open(appendfile, 'w') as f: