aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-03-18 21:38:33 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-01 14:35:40 +0100
commit2aa75224b5a03cc115db37b46409b3faaa305423 (patch)
tree0d3c51cb8cc8fc291723e2b63f2a17da19afac5a /meta/classes/kernel-yocto.bbclass
parent4ee454d3569cb7a9556f41b770d9fbe8823d5a01 (diff)
downloadopenembedded-core-contrib-2aa75224b5a03cc115db37b46409b3faaa305423.tar.gz
kernel-yocto: use show-ref instead of branch -a
It's better to check a branches existence via show-ref versus the end user branch commands. So we make the switch. Also as part of this change, we move the conversion of remote branches to local branches above the meta branch checking. This is required to ensure that the branch is local for the show-ref check. (From OE-Core rev: 04bd4cee625574cfa67679b6b2a150a21106c5bf) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass22
1 files changed, 11 insertions, 11 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 0ac1572471..9209f423cf 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -200,11 +200,20 @@ do_kernel_checkout() {
fi
# end debare
+ # convert any remote branches to local tracking ones
+ for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
+ b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
+ git show-ref --quiet --verify -- "refs/heads/$b"
+ if [ $? -ne 0 ]; then
+ git branch $b $i > /dev/null
+ fi
+ done
+
# If KMETA is defined, the branch must exist, but a machine branch
# can be missing since it may be created later by the tools.
if [ -n "${KMETA}" ]; then
- git branch -a --no-color | grep -q ${KMETA}
- if [ $? -ne 0 ]; then
+ git show-ref --quiet --verify -- "refs/heads/${KMETA}"
+ if [ $? -eq 1 ]; then
echo "ERROR. The branch '${KMETA}' is required and was not"
echo "found. Ensure that the SRC_URI points to a valid linux-yocto"
echo "kernel repository"
@@ -214,15 +223,6 @@ do_kernel_checkout() {
machine_branch="${@ get_machine_branch(d, "${KBRANCH}" )}"
- # convert any remote branches to local tracking ones
- for i in `git branch -a --no-color | grep remotes | grep -v HEAD`; do
- b=`echo $i | cut -d' ' -f2 | sed 's%remotes/origin/%%'`;
- git show-ref --quiet --verify -- "refs/heads/$b"
- if [ $? -ne 0 ]; then
- git branch $b $i > /dev/null
- fi
- done
-
# Create a working tree copy of the kernel by checking out a branch
git show-ref --quiet --verify -- "refs/heads/${machine_branch}"
if [ $? -eq 0 ]; then