Openembedded Core Discussions
 help / color / mirror / Atom feed
* [PATCH 0/1] buildhistory: improve git commit robustness
@ 2011-12-30 13:36 Paul Eggleton
  2011-12-30 13:36 ` [PATCH 1/1] " Paul Eggleton
  2012-01-04  0:05 ` [PATCH 0/1] " Saul Wold
  0 siblings, 2 replies; 3+ messages in thread
From: Paul Eggleton @ 2011-12-30 13:36 UTC (permalink / raw)
  To: openembedded-core

The following change since commit 8f348ccad083d6c02c200652ff6295e701e88f0d:

  coreutils: ensure --color works so DEPEND on libcap (2011-12-24 10:05:35 +0000)

is available in the git repository at:
  git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-fix2
  http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-fix2

Paul Eggleton (1):
  buildhistory: improve git commit robustness

 meta/classes/buildhistory.bbclass |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

-- 
1.7.5.4




^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 1/1] buildhistory: improve git commit robustness
  2011-12-30 13:36 [PATCH 0/1] buildhistory: improve git commit robustness Paul Eggleton
@ 2011-12-30 13:36 ` Paul Eggleton
  2012-01-04  0:05 ` [PATCH 0/1] " Saul Wold
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Eggleton @ 2011-12-30 13:36 UTC (permalink / raw)
  To: openembedded-core

* Check if BUILDHISTORY_DIR exists before doing anything with it, in
  case no tasks that would have created it have executed
* Ensure the git repo in BUILDHISTORY_DIR is initialised with "git init"
  before attempting to do anything with it
* Check if any files have been added or changed before adding and
  committing, to avoid an error from "git commit"

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
---
 meta/classes/buildhistory.bbclass |   21 +++++++++++++++++----
 1 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 39f5ff6..afd0fb5 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -339,11 +339,24 @@ def buildhistory_get_layers(d):
 
 
 buildhistory_commit() {
+	if [ ! -d ${BUILDHISTORY_DIR} ] ; then
+		# Code above that creates this dir never executed, so there can't be anything to commit
+		exit
+	fi
+
 	( cd ${BUILDHISTORY_DIR}/
-		git add ${BUILDHISTORY_DIR}/*
-		git commit ${BUILDHISTORY_DIR}/ -m "Build ${BUILDNAME} for machine ${MACHINE} configured for ${DISTRO} ${DISTRO_VERSION}" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
-		if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
-			git push -q ${BUILDHISTORY_PUSH_REPO}
+		# Initialise the repo if necessary
+		if [ ! -d .git ] ; then
+			git init -q
+		fi
+		# Ensure there are new/changed files to commit
+		repostatus=`git status --porcelain`
+		if [ "$repostatus" != "" ] ; then
+			git add ${BUILDHISTORY_DIR}/*
+			git commit ${BUILDHISTORY_DIR}/ -m "Build ${BUILDNAME} for machine ${MACHINE} configured for ${DISTRO} ${DISTRO_VERSION}" --author "${BUILDHISTORY_COMMIT_AUTHOR}" > /dev/null
+			if [ "${BUILDHISTORY_PUSH_REPO}" != "" ] ; then
+				git push -q ${BUILDHISTORY_PUSH_REPO}
+			fi
 		fi) || true
 }
 
-- 
1.7.5.4




^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 0/1] buildhistory: improve git commit robustness
  2011-12-30 13:36 [PATCH 0/1] buildhistory: improve git commit robustness Paul Eggleton
  2011-12-30 13:36 ` [PATCH 1/1] " Paul Eggleton
@ 2012-01-04  0:05 ` Saul Wold
  1 sibling, 0 replies; 3+ messages in thread
From: Saul Wold @ 2012-01-04  0:05 UTC (permalink / raw)
  To: Patches and discussions about the oe-core layer; +Cc: Paul Eggleton

On 12/30/2011 05:36 AM, Paul Eggleton wrote:
> The following change since commit 8f348ccad083d6c02c200652ff6295e701e88f0d:
>
>    coreutils: ensure --color works so DEPEND on libcap (2011-12-24 10:05:35 +0000)
>
> is available in the git repository at:
>    git://git.openembedded.org/openembedded-core-contrib paule/buildhistory-fix2
>    http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=paule/buildhistory-fix2
>
> Paul Eggleton (1):
>    buildhistory: improve git commit robustness
>
>   meta/classes/buildhistory.bbclass |   21 +++++++++++++++++----
>   1 files changed, 17 insertions(+), 4 deletions(-)
>

Merged into OE-Core

Thanks
	Sau!



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-04  0:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-30 13:36 [PATCH 0/1] buildhistory: improve git commit robustness Paul Eggleton
2011-12-30 13:36 ` [PATCH 1/1] " Paul Eggleton
2012-01-04  0:05 ` [PATCH 0/1] " Saul Wold

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox