From: Bruce Ashfield Date: Sun, 31 Aug 2014 05:18:24 +0000 (-0400) Subject: kernel-yocto: replace --is-ancestor with basic git porcelain commands X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~32512 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ddfffe52720d1df70b04131eac553776da7bc73;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git kernel-yocto: replace --is-ancestor with basic git porcelain commands --is-ancestor is a relatively new git option [commit 5907cda1, Aug 30 2012]. To support build machines with older versions of git installed, we can use the basic porcelain commands to acheive the same check. merge-base: "--is-ancestor A B" can be replaced with: if test "$(git rev-parse --verify A)" = "$(git merge-base A B)" Signed-off-by: Bruce Ashfield Signed-off-by: Richard Purdie --- diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass index ee09769d461..929d64a2902 100644 --- a/meta/classes/kernel-yocto.bbclass +++ b/meta/classes/kernel-yocto.bbclass @@ -131,8 +131,7 @@ do_patch() { # check to see if the specified SRCREV is reachable from the final branch. # if it wasn't something wrong has happened, and we should error. if [ "${machine_srcrev}" != "AUTOINC" ]; then - git merge-base --is-ancestor ${machine_srcrev} HEAD - if [ $? -ne 0 ]; then + if ! [ "$(git rev-parse --verify ${machine_srcrev})" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then bberror "SRCREV ${machine_srcrev} was specified, but is not reachable" bbfatal "Check the BSP description for incorrect branch selection, or other errors." fi