Module: setup-scripts
Branch: master
Commit: dc7d28b887670378b4f95a14eb0afc6dc85b4dc6

Author: Koen Kooi <k...@dominion.thruhere.net>
Date:   Wed Jan 11 12:32:41 2012 +0100

layerman: add command to tag all layers

Signed-off-by: Koen Kooi <k...@dominion.thruhere.net>

---

 scripts/layerman   |   33 ++++++++++++++++++++++++++-------
 scripts/layers.awk |    5 ++---
 2 files changed, 28 insertions(+), 10 deletions(-)

diff --git a/scripts/layerman b/scripts/layerman
index 7d6a7a9..2ce48be 100755
--- a/scripts/layerman
+++ b/scripts/layerman
@@ -5,10 +5,11 @@ LAYERURI=$2
 BRANCH=$3
 REV=$4
 COMMAND=$5
+COMMANDARG=$6
 
 LAYERDIR="${OE_SOURCE_DIR}/${LAYERNAME}"
 
-function update_layers() {
+function check_layer() {
     if ! [ -e ${LAYERDIR} ] ; then
         echo "Layer checkout missing at ${LAYERDIR}, creating one"
         git clone ${LAYERURI} ${LAYERDIR}
@@ -21,21 +22,39 @@ function update_layers() {
         if [ "${REV}" != "HEAD" ] ; then
             git checkout ${REV}
         fi
-    else
-        if [ "${REV}" = "HEAD" ] ; then
-            cd ${LAYERDIR} && echo "Updating layer at layers/${LAYERNAME}" && 
git stash >&/dev/null && git pull --rebase && git stash pop >& /dev/null
-        fi
-        echo ""
     fi
+}
+
+function update_layers() {
+    check_layer
+
+    if [ "${REV}" = "HEAD" ] ; then
+        cd ${LAYERDIR} && echo "Updating layer at layers/${LAYERNAME}" && git 
stash >&/dev/null && git pull --rebase && git stash pop >& /dev/null
+    fi
+    echo ""
 
     echo "Layers present in repository:"
     find ${LAYERDIR} -name "layer.conf" | sed -e s:${LAYERDIR}:${LAYERNAME}:g 
-e s:/conf/layer\.conf::g
     echo
 }
 
+function tag_layers() {
+    check_layer
+    cd ${LAYERDIR} && echo "Tagging layer with $COMMANDARG" && git tag 
$COMMANDARG
+    echo ""
+}
+
+function diff_tags() {
+    check_layer
+    cd ${LAYERDIR} && echo "Changes in between $COMMANDARG" && git shortlog 
$COMMANDARG
+    echo ""
+}
+
 case $COMMAND in
 tag)
-    tag;;
+    tag_layers;;
+changelog)
+    diff_tags;;
 *)
     update_layers;;
 esac
diff --git a/scripts/layers.awk b/scripts/layers.awk
index 9faa237..c360037 100755
--- a/scripts/layers.awk
+++ b/scripts/layers.awk
@@ -1,10 +1,9 @@
-#!/usr/bin/awk -f
 
-BEGIN { 
+BEGIN {
        FS =",";
        print "Configured layers:\n";
  }
 
-$1 != "# Name" { print "layer repository name: " $1 "\nlayer uri: " $2 
"\nlayer branch/revision: " $3 "/" $4 ; system("${OE_BASE}/scripts/layerman " 
$1 " "  $2 " " $3 " " $4);}
+$1 != "# Name" { print "layer repository nam/e: " $1 "\nlayer uri: " $2 
"\nlayer branch/revision: " $3 "/" $4 ; system("${OE_BASE}/scripts/layerman " 
$1 " "  $2 " " $3 " " $4 " " command " " commandarg);}
 
 


_______________________________________________
Angstrom-distro-devel mailing list
Angstrom-distro-devel@linuxtogo.org
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/angstrom-distro-devel

Reply via email to