summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/lib/oeqa/selftest/devtool.py2
-rw-r--r--scripts/lib/devtool/standard.py23
2 files changed, 25 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py
index 2a08721336..7db286fc15 100644
--- a/meta/lib/oeqa/selftest/devtool.py
+++ b/meta/lib/oeqa/selftest/devtool.py
@@ -874,6 +874,8 @@ class DevtoolTests(DevtoolBase):
874 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir)) 874 result = runCmd('devtool modify %s -x %s' % (testrecipe, tempdir))
875 # Check git repo 875 # Check git repo
876 self._check_src_repo(tempdir) 876 self._check_src_repo(tempdir)
877 # Try building just to ensure we haven't broken that
878 bitbake("%s" % testrecipe)
877 # Edit / commit local source 879 # Edit / commit local source
878 runCmd('echo "/* Foobar */" >> oe-local-files/makedevs.c', cwd=tempdir) 880 runCmd('echo "/* Foobar */" >> oe-local-files/makedevs.c', cwd=tempdir)
879 runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir) 881 runCmd('echo "Foo" > oe-local-files/new-local', cwd=tempdir)
diff --git a/scripts/lib/devtool/standard.py b/scripts/lib/devtool/standard.py
index 34de7bd623..e4d2a57ab6 100644
--- a/scripts/lib/devtool/standard.py
+++ b/scripts/lib/devtool/standard.py
@@ -674,6 +674,29 @@ def _extract_source(srctree, keep_temp, devbranch, sync, d):
674 674
675 shutil.move(srcsubdir, srctree) 675 shutil.move(srcsubdir, srctree)
676 676
677 if os.path.abspath(d.getVar('S', True)) == os.path.abspath(d.getVar('WORKDIR', True)):
678 # If recipe extracts to ${WORKDIR}, symlink the files into the srctree
679 # (otherwise the recipe won't build as expected)
680 local_files_dir = os.path.join(srctree, 'oe-local-files')
681 addfiles = []
682 for root, _, files in os.walk(local_files_dir):
683 relpth = os.path.relpath(root, local_files_dir)
684 if relpth != '.':
685 bb.utils.mkdirhier(os.path.join(srctree, relpth))
686 for fn in files:
687 if fn == '.gitignore':
688 continue
689 destpth = os.path.join(srctree, relpth, fn)
690 if os.path.exists(destpth):
691 os.unlink(destpth)
692 os.symlink('oe-local-files/%s' % fn, destpth)
693 addfiles.append(os.path.join(relpth, fn))
694 if addfiles:
695 bb.process.run('git add %s' % ' '.join(addfiles), cwd=srctree)
696 useroptions = []
697 oe.patch.GitApplyTree.gitCommandUserOptions(useroptions, d=d)
698 bb.process.run('git %s commit -a -m "Committing local file symlinks\n\n%s"' % (' '.join(useroptions), oe.patch.GitApplyTree.ignore_commit_prefix), cwd=srctree)
699
677 if kconfig: 700 if kconfig:
678 logger.info('Copying kernel config to srctree') 701 logger.info('Copying kernel config to srctree')
679 shutil.copy2(kconfig, srctree) 702 shutil.copy2(kconfig, srctree)