summaryrefslogtreecommitdiff
path: root/meta/classes/kernel-yocto.bbclass
diff options
context:
space:
mode:
authorBruce Ashfield <bruce.ashfield@windriver.com>2014-03-17 14:00:15 -0400
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-09-01 14:34:25 +0100
commit228c05013fe691321ec00467d8d0c0bb64dd175c (patch)
treee8d5fe5a82e6ad844e86821f2a2a535010bb8315 /meta/classes/kernel-yocto.bbclass
parent05508339882c7cc1fe3f1f67f72314fdcab979b7 (diff)
downloadopenembedded-core-228c05013fe691321ec00467d8d0c0bb64dd175c.tar.gz
openembedded-core-228c05013fe691321ec00467d8d0c0bb64dd175c.tar.bz2
openembedded-core-228c05013fe691321ec00467d8d0c0bb64dd175c.zip
kernel-yocto: use cat-file instead of git-show
Parsing the output of git show is error prone, since it changes based on the type of issue with bad comit IDs. Since the output is no longer used in the case of a valid ref, we can switch to git-cat-file and simply check the return code. Signed-off-by: Darren Hart <dvhart@linux.intel.com> Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
Diffstat (limited to 'meta/classes/kernel-yocto.bbclass')
-rw-r--r--meta/classes/kernel-yocto.bbclass8
1 files changed, 4 insertions, 4 deletions
diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 6c92427704..38c886b21b 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -321,8 +321,8 @@ do_validate_branches() {
fi
fi
- ref=`git show ${machine_srcrev} 2>&1 | head -n1 || true`
- if [ "$ref" = "fatal: bad object ${target_meta_head}" ]; then
+ git cat-file -t ${machine_srcrev} > /dev/null
+ if [ if $? -ne 0 ]; then
echo "ERROR ${machine_srcrev} is not a valid commit ID."
echo "The kernel source tree may be out of sync"
exit 1
@@ -358,8 +358,8 @@ do_validate_branches() {
git show-ref --quiet --verify -- "refs/heads/${KMETA}"
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
+ git cat-file -t ${target_meta_head} > /dev/null
+ if [ $? -ne 0 ]; then
echo "ERROR ${target_meta_head} is not a valid commit ID"
echo "The kernel source tree may be out of sync"
exit 1