Patchwork [2/2] kernel-yocto: set master branch to a defined SRCREV

login
register
mail settings
Submitter Bruce Ashfield
Date Aug. 23, 2012, 4:08 a.m.
Message ID <46e45318d189cf9846e2ee3bf3e7bc3a881a0ffe.1345694632.git.bruce.ashfield@windriver.com>
Download mbox | patch
Permalink /patch/35197/
State Accepted
Commit de5bb5879fa3282c46dc1ede36af34eaab8f647f
Headers show

Comments

Bruce Ashfield - Aug. 23, 2012, 4:08 a.m.
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@windriver.com>
---
 meta/classes/kernel-yocto.bbclass                  |   12 ++++++++----
 .../kern-tools/kern-tools-native_git.bb            |    2 +-
 2 files changed, 9 insertions(+), 5 deletions(-)

Patch

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index bb0915c..3dcc8b5 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -274,11 +274,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
 
diff --git a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
index 974b86e..0ff8b19 100644
--- a/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
+++ b/meta/recipes-kernel/kern-tools/kern-tools-native_git.bb
@@ -4,7 +4,7 @@  LIC_FILES_CHKSUM = "file://git/tools/kgit;beginline=5;endline=9;md5=d8d1d729a70c
 
 DEPENDS = "git-native guilt-native"
 
-SRCREV = "33068f21169b327c64ac7e957fe9d89c391897a3"
+SRCREV = "7d936da57db11f1114f3860e4fcc15221e796275"
 PR = "r12"
 PV = "0.1+git${SRCPV}"