diff options
author | Bruce Ashfield <bruce.ashfield@windriver.com> | 2014-02-21 00:01:00 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-02-28 14:01:14 +0000 |
commit | bd2665a0c1d51677c9f52c14a2f4fb831540f299 (patch) | |
tree | 679c033cd9068ef9938233daf57323fb5b9e47b8 /meta | |
parent | 83b20f850881580660b74d571edf2f2586a7d473 (diff) | |
download | poky-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')
-rw-r--r-- | meta/classes/kernel-yocto.bbclass | 37 |
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() { | |||
358 | fi | 358 | fi |
359 | done | 359 | done |
360 | 360 | ||
361 | ## KMETA branch validation | 361 | ## KMETA branch validation. |
362 | ## We do validation if the meta branch exists, and AUTOREV hasn't been set | ||
362 | meta_head=`git show-ref -s --heads ${KMETA}` | 363 | meta_head=`git show-ref -s --heads ${KMETA}` |
363 | target_meta_head="${SRCREV_meta}" | 364 | target_meta_head="${SRCREV_meta}" |
364 | git show-ref --quiet --verify -- "refs/heads/${KMETA}" | 365 | git show-ref --quiet --verify -- "refs/heads/${KMETA}" |
365 | if [ $? -eq 1 ]; then | 366 | if [ $? -eq 0 ] && [ "${target_meta_head}" != "AUTOINC" ]; then |
366 | return | 367 | if [ "$meta_head" != "$target_meta_head" ]; then |
367 | fi | 368 | ref=`git show ${target_meta_head} 2>&1 | head -n1 || true` |
368 | 369 | if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then | |
369 | if [ "${target_meta_head}" = "AUTOINC" ]; then | 370 | echo "ERROR ${target_meta_head} is not a valid commit ID" |
370 | return | 371 | echo "The kernel source tree may be out of sync" |
371 | fi | ||
372 | |||
373 | if [ "$meta_head" != "$target_meta_head" ]; then | ||
374 | ref=`git show ${target_meta_head} 2>&1 | head -n1 || true` | ||
375 | if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then | ||
376 | echo "ERROR ${target_meta_head} is not a valid commit ID" | ||
377 | echo "The kernel source tree may be out of sync" | ||
378 | exit 1 | ||
379 | else | ||
380 | echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}" | ||
381 | git branch -m ${KMETA} ${KMETA}-orig | ||
382 | git checkout -q -b ${KMETA} ${target_meta_head} | ||
383 | if [ $? -ne 0 ];then | ||
384 | echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}" | ||
385 | exit 1 | 372 | exit 1 |
373 | else | ||
374 | echo "[INFO] Setting branch ${KMETA} to ${target_meta_head}" | ||
375 | git branch -m ${KMETA} ${KMETA}-orig | ||
376 | git checkout -q -b ${KMETA} ${target_meta_head} | ||
377 | if [ $? -ne 0 ];then | ||
378 | echo "ERROR: could not checkout ${KMETA} branch from known hash ${target_meta_head}" | ||
379 | exit 1 | ||
380 | fi | ||
386 | fi | 381 | fi |
387 | fi | 382 | fi |
388 | fi | 383 | fi |