aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-02-21 00:01:00 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-02-28 14:01:14 +0000
commitbd2665a0c1d51677c9f52c14a2f4fb831540f299 (patch)
tree679c033cd9068ef9938233daf57323fb5b9e47b8 /meta/classes/kernel-yocto.bbclass
parent83b20f850881580660b74d571edf2f2586a7d473 (diff)
downloadopenembedded-core-contrib-bd2665a0c1d51677c9f52c14a2f4fb831540f299.tar.gz
kernel-yocto: always checkout machine branch when existing validate_branches
The validate_branches routine is responsible for ensuring that the specified SRCREV exists, and that the tree has been prepared for eventual patching starting directly from that SRCREV. On exit, the routine checks out the specified machine branch and the preparation is complete .. except if a KMETA branch isn't used, we exit early since the branch can't be validated. To make the exit condition consistent for all cases, we can move the KMETA validation inside a conditional and allow the same exit path for both cases. (From OE-Core rev: 6eb63237c3bf48377f75e48e637d76108c8666df) Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com> Signed-off-by: Saul Wold <sgw@linux.intel.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.bbclass37
1 files changed, 16 insertions, 21 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index fab5d4c570..fb8e04e704 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -358,31 +358,26 @@ do_validate_branches() {
fi
done
- ## KMETA branch validation
+ ## KMETA branch validation.
+ ## We do validation if the meta branch exists, and AUTOREV hasn't been set
meta_head=`git show-ref -s --heads ${KMETA}`
target_meta_head="${SRCREV_meta}"
git show-ref --quiet --verify -- "refs/heads/${KMETA}"
- if [ $? -eq 1 ]; then
- return
- fi
-
- if [ "${target_meta_head}" = "AUTOINC" ]; then
- return
- fi
-
- if [ "$meta_head" != "$target_meta_head" ]; then
- ref=`git show ${target_meta_head} 2>&1 | head -n1 || true`
- if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then
- echo "ERROR ${target_meta_head} is not a valid commit ID"
- echo "The kernel source tree may be out of sync"
- exit 1
- else
- echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}"
- git branch -m ${KMETA} ${KMETA}-orig
- git checkout -q -b ${KMETA} ${target_meta_head}
- if [ $? -ne 0 ];then
- echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}"
+ if [ $? -eq 0 ] && [ "${target_meta_head}" != "AUTOINC" ]; then
+ if [ "$meta_head" != "$target_meta_head" ]; then
+ ref=`git show ${target_meta_head} 2>&1 | head -n1 || true`
+ if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then
+ echo "ERROR ${target_meta_head} is not a valid commit ID"
+ echo "The kernel source tree may be out of sync"
exit 1
+ else
+ echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}"
+ git branch -m ${KMETA} ${KMETA}-orig
+ git checkout -q -b ${KMETA} ${target_meta_head}
+ if [ $? -ne 0 ];then
+ echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}"
+ exit 1
+ fi
fi
fi
fi