diff options
author | Jianxun Zhang <jianxun.zhang@linux.intel.com> | 2015-12-08 10:58:43 -0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-12-27 11:26:58 +0000 |
commit | ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69 (patch) | |
tree | f1174eccdd9b512ab034eba5af07954c8d3b721a /meta/classes | |
parent | 1df3a79cf454754e6be6c1ffc91ba8310a880616 (diff) | |
download | openembedded-core-ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69.tar.gz openembedded-core-ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69.tar.bz2 openembedded-core-ccfa2ee5c4f509de4c18a7054b2a66fc874d5d69.zip |
kernel-yocto: fix checkout bare-cloned kernel repositories
The existing code doesn't tell regular (with .git) and bare cases and
just move the unpacked repo to the place of kernel source. But later
steps will fail on a bare-cloned repo because we can not checkout
directly in a bare cloned repo.
This change performs another clone to fix the issue.
Note: This change doesn't cover the case that S and WORKDIR are same
and the repo is bare cloned.
Signed-off-by: Jianxun Zhang <jianxun.zhang@linux.intel.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index 00d9667fe0..c2d0d3076f 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -184,11 +184,18 @@ do_kernel_checkout() { source_dir=`echo ${S} | sed 's%/$%%'` source_workdir="${WORKDIR}/git" if [ -d "${WORKDIR}/git/" ]; then - # case: git repository (bare or non-bare) + # case: git repository # if S is WORKDIR/git, then we shouldn't be moving or deleting the tree. if [ "${source_dir}" != "${source_workdir}" ]; then - rm -rf ${S} - mv ${WORKDIR}/git ${S} + if [ -d "${source_workdir}/.git" ]; then + # regular git repository with .git + rm -rf ${S} + mv ${WORKDIR}/git ${S} + else + # create source for bare cloned git repository + git clone ${WORKDIR}/git ${S} + rm -rf ${WORKDIR}/git + fi fi cd ${S} else |