]> code.ossystems Code Review - openembedded-core.git/commit
externalsrc: Fix parsing error with devtool non-git sources
authorTomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Wed, 20 Jan 2021 14:55:25 +0000 (15:55 +0100)
committerAnuj Mittal <anuj.mittal@intel.com>
Mon, 1 Feb 2021 04:48:14 +0000 (12:48 +0800)
commit1da57e92812a1025d975204797b761a3be3998aa
treeb521fdf62c1b14e92b9c6ef68bab020a10754a05
parentf500435958fd676a00757a64572f06f5cb16c251
externalsrc: Fix parsing error with devtool non-git sources

If srcdir is under poky directory (e.g. devtool poky/build/workspace/sources)
and is not a git repository then ${@srctree_hash_files(d)} will run "git
rev-parse --git-dir" and detect poky directory as git-dir and run "'git', 'add',
'-A', '.'], cwd=s_dir" trying to add srcdir but build dir is in .gitignore and
latest git will fail with "The following paths are ignored by one of your
.gitignore files: build" which will end with "ExpansionError during parsing".

In this commit I added a check if git_dir is the same as git-dir from
TOPDIR (which will detect poky directory) and if yes, then treat srcdir
as non-git sources.

(From OE-Core rev: 95fbac8dcad6c93f4c9737e9fe13e92ab6befa09)

Signed-off-by: Tomasz Dziendzielski <tomasz.dziendzielski@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit 28bdfe0066cb3c41d6471af75dabcc573e319688)
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
meta/classes/externalsrc.bbclass