[oe-commits] Jeff Wang : kernel-yocto: make sure git tags get dereferenced properly in do_patch()

git at git.openembedded.org git at git.openembedded.org
Thu Dec 18 13:03:11 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: c803105ceecada95ec1b88785323b9cde751bdd0
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=c803105ceecada95ec1b88785323b9cde751bdd0

Author: Jeff Wang <jeffrey.wang at mit.ll.edu>
Date:   Fri Nov  7 09:45:32 2014 -0500

kernel-yocto: make sure git tags get dereferenced properly in do_patch()

Commit 92c1ece6c347030d48995a36f4c67861356e59d3 causes the test in do_patch()
in kernel-yocto.bbclass to fail if ${machine_srcrev} is an annotated tag. The
check is meant to ensure that ${machine_srcrev} is an ancestor of HEAD, but
if ${machine_srcrev} is a tag, then "$(git rev-parse --verify
${machine_srcrev})" evaluates to the SHA of the tag instead of what it's
pointing to.

Replacing "$(git rev-parse --verify ${machine_srcrev})" with "$(git rev-parse
--verify ${machine_srcrev}~0)" fixed the problem by finding the object pointed
to by the tag, and not the tag itself. This also works for commit IDs that
are not tags, hence is safe in a scenarios.

Jeff Wang <jeffrey.wang at ll.mit.edu>
Signed-off-by: Bruce Ashfield <bruce.ashfield at windriver.com>

---

 meta/classes/kernel-yocto.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 5706a9e..3b59d85 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -129,7 +129,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
-		if ! [ "$(git rev-parse --verify ${machine_srcrev})" = "$(git merge-base ${machine_srcrev} HEAD)" ]; then
+		if ! [ "$(git rev-parse --verify ${machine_srcrev}~0)" = "$(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



More information about the Openembedded-commits mailing list