Patchwork [1/1] kernel-yocto: checkout known branch before leaving do_validate_branches

login
register
mail settings
Submitter Bruce Ashfield
Date Nov. 29, 2012, 6:42 p.m.
Message ID <e7403df2bde00da021302a58fed6e782784ca629.1354214034.git.bruce.ashfield@windriver.com>
Download mbox | patch
Permalink /patch/39885/
State Accepted
Commit 57397592ff8ec16922604d398c18d53a589be41f
Headers show

Comments

Bruce Ashfield - Nov. 29, 2012, 6:42 p.m.
We should always leave the tree on a BSP branch or master when
do_validate_branches completes to avoid modifying version tracked
files are part of the build process. Modifying these files will lead
to errors when changing branches, since the contents would be lost.

This is evident in the case that a the meta branch is reset to a
known SRCREV and the tree was left on the meta branch. This branch
tracks the meta/meta-series, and other artifacts of the original
tree construction. When the build process runs, it updates these same
files, which creates a conflict when switching branches.

This has been fixed in the tree construction scripts to not track
these files, but a secondary fix is also required of not leaving
the build on these branches, to allow arbitrary trees to be built.

[YOCTO #3413]

Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
---
 meta/classes/kernel-yocto.bbclass |    2 ++
 1 file changed, 2 insertions(+)

Patch

diff --git a/meta/classes/kernel-yocto.bbclass b/meta/classes/kernel-yocto.bbclass
index 0d4ed21..c74317e 100644
--- a/meta/classes/kernel-yocto.bbclass
+++ b/meta/classes/kernel-yocto.bbclass
@@ -327,6 +327,8 @@  do_validate_branches() {
 	if [ $? -eq 0 ]; then
 		# restore the branch for builds
 		git checkout -q -f ${KBRANCH}
+        else
+	        git checkout -q master
 	fi
 }