[oe-commits] Bruce Ashfield : kernel-yocto: set master branch to a defined SRCREV

git at git.openembedded.org git at git.openembedded.org
Fri Sep 28 16:00:04 UTC 2012


Module: openembedded-core.git
Branch: denzil
Commit: 3a8dc0a01d2756bb8f51afccad772fca1dc48af3
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=3a8dc0a01d2756bb8f51afccad772fca1dc48af3

Author: Bruce Ashfield <bruce.ashfield at windriver.com>
Date:   Wed Aug 22 01:18:05 2012 -0400

kernel-yocto: set master branch to a defined SRCREV

To support custom repositories that set a SRCREV and that only have
a single master branch, do_validate_branches needs a special case
for 'master'. We can't delete and recreate the branch, since you
cannot delete the current branch, instead we must reset the branch
to the proper SRCREV.

Signed-off-by: Bruce Ashfield <bruce.ashfield at windriver.com>

---

 meta/classes/kernel-yocto.bbclass |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index d859d76..e6758cf 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -270,11 +270,15 @@ do_validate_branches() {
 	# SRCREV (if it isn't the current HEAD of that branch)
 	git checkout -q master
 	for b in $containing_branches; do
-		branch_head=`git show-ref -s --heads ${b}`
+		branch_head=`git show-ref -s --heads ${b}`		
 		if [ "$branch_head" != "$target_branch_head" ]; then
-			echo "[INFO] Setting branch $b to ${target_branch_head}"	      
-			git branch -D $b > /dev/null
-			git branch $b $target_branch_head > /dev/null
+			echo "[INFO] Setting branch $b to ${target_branch_head}"
+			if [ "$b" == "master" ]; then
+				git reset --hard $target_branch_head > /dev/null
+			else
+				git branch -D $b > /dev/null
+				git branch $b $target_branch_head > /dev/null
+			fi
 		fi
 	done
 





More information about the Openembedded-commits mailing list