[OE-core] [PATCH 6/9] scripts: add buildhistory-tag script

Paul Eggleton paul.eggleton at linux.intel.com
Thu Aug 2 09:23:06 UTC 2012


This trivial script determines BUILDHISTORY_DIR using bitbake and then
passes the command line options to "git tag" on the buildhistory
repository. This is useful for setting a tag before making some changes;
even if the build takes a number of executions of bitbake (resulting in
multiple commits to the buildhistory repository) you can still do the
overall comparison easily.

Suggested by Ross Burton <ross.burton at intel.com>.

Signed-off-by: Paul Eggleton <paul.eggleton at linux.intel.com>
---
 scripts/buildhistory-tag |   42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100755 scripts/buildhistory-tag

diff --git a/scripts/buildhistory-tag b/scripts/buildhistory-tag
new file mode 100755
index 0000000..da90bcf
--- /dev/null
+++ b/scripts/buildhistory-tag
@@ -0,0 +1,42 @@
+#!/bin/sh
+
+# buildhistory-tag
+#
+# Copyright (C) 2012 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+#
+
+if [ -z $1 ] ; then
+    echo "Please specify at least the name of the tag to set"
+    exit 1
+fi
+
+BUILDHISTORY_DIR=`bitbake -e | grep '^BUILDHISTORY_DIR=' | sed -e 's/^[A-Z_]*=//' -e 's/"//g'`
+if [ -z "$BUILDHISTORY_DIR" ]; then
+    echo "Unable to determine BUILDHISTORY_DIR"
+    exit 1
+fi
+
+if [ ! -d "$BUILDHISTORY_DIR" ]; then
+    echo "BUILDHISTORY_DIR $BUILDHISTORY_DIR does not exist"
+    exit 1
+fi
+
+if [ ! -d "$BUILDHISTORY_DIR/.git" ]; then
+    echo "BUILDHISTORY_DIR $BUILDHISTORY_DIR exists but is not a git repository"
+    exit 1
+fi
+
+(cd $BUILDHISTORY_DIR; git tag $@)
-- 
1.7.9.5





More information about the Openembedded-core mailing list