From: "Franklin S. Cooper Jr" <[email protected]>

* Previously if you saved the git repository with sourceipk and did a git status
  you would see "# Not currently on any branch." since when checking out a git
  repository OE will use a commit id.
* Also since SDKs tend to depend on git repositories based on a tag there is
  generally no SDK branch that can refer people to which means they end up
  creating their own SDK branch.
* This patch adds several variables that creates a local branch based on the
  commit the recipe uses. A variable is also used to specify a "commit"
  message that can be used to explain the purpose of the branch.

Signed-off-by: Franklin S. Cooper Jr <[email protected]>
---
 meta-arago-distro/classes/sourceipk.bbclass |   37 +++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

diff --git a/meta-arago-distro/classes/sourceipk.bbclass 
b/meta-arago-distro/classes/sourceipk.bbclass
index 6895378..26d3922 100644
--- a/meta-arago-distro/classes/sourceipk.bbclass
+++ b/meta-arago-distro/classes/sourceipk.bbclass
@@ -61,6 +61,16 @@ SRCIPK_INCLUDE_EXTRAFILES ?= "1"
 
 SRCIPK_PRESERVE_GIT ?= "false"
 
+# Git commit message that explains the purpose of the custom git branch
+SRCIPK_CUSTOM_GIT_MESSAGE ?= ""
+
+# File that will store the same information as the commit message but is also
+# used to add something to insure a commit can be committed.
+SRCIPK_SDK_README ?= "TISDK-README"
+
+# Name used when creating the custom branch
+SRCIPK_CUSTOM_GIT_BRANCH ?= ""
+
 # Create a shallow clone of the git repository to reduce the size of
 # the sourceipk
 SRCIPK_SHALLOW_CLONE ?= "false"
@@ -167,6 +177,33 @@ adjust_git() {
             # (remote) git repository
             git repack -a -d
 
+
+            if [ "${SRCIPK_CUSTOM_GIT_BRANCH}" != "" -a 
"${SRCIPK_CUSTOM_GIT_MESSAGE}" != "" ]
+            then
+
+                # Create local git config settings to create commit
+                git config user.email "<>"
+                git config user.name "Texas Instruments SDK Builder"
+
+                # For recipes like the kernel which may end up running
+                # sourceipk more than once.
+                branch_exist=`git branch | grep ${SRCIPK_CUSTOM_GIT_BRANCH}` 
|| echo ""
+                if [ "$branch_exist" != "" -a -f ${SRCIPK_SDK_README} ]
+                then
+                    git add -A
+                    git commit --amend
+                else
+                    echo -e ${SRCIPK_CUSTOM_GIT_MESSAGE} > ${SRCIPK_SDK_README}
+                    git add -A
+                    git commit -F ${SRCIPK_SDK_README}
+                    git checkout -b "${SRCIPK_CUSTOM_GIT_BRANCH}"
+                fi
+
+                # Delete local git config settings
+                rm .gitconfig .git/config > /dev/null 2>&1 || echo ""
+
+            fi
+
             rm -f .git/objects/info/alternates
 
         else
-- 
1.7.9.5

_______________________________________________
meta-arago mailing list
[email protected]
http://arago-project.org/cgi-bin/mailman/listinfo/meta-arago

Reply via email to