Skip to content

Commit

Permalink
Adding support for checkout of particular tag/branch
Browse files Browse the repository at this point in the history
Signed-off-by: Radek Dostal <rd@radekdostal.com>
  • Loading branch information
dasty authored and koenkooi committed May 4, 2012
1 parent 949ecf2 commit 26ef55c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
22 changes: 22 additions & 0 deletions oebb.sh
Expand Up @@ -354,6 +354,16 @@ function layer_info()
echo
}

###############################################################################
# checkout - Checkout all layers with a given tag
###############################################################################
function checkout()
{
set_environment
env gawk -v command=checkout -v commandarg=$TAG -f ${OE_BASE}/scripts/layers.awk ${OE_SOURCE_DIR}/layers.txt
}


###############################################################################
# Build the specified OE packages or images.
###############################################################################
Expand Down Expand Up @@ -397,6 +407,17 @@ then
exit 0
fi

if [ $1 = "checkout" ]
then
if [ -z $2 ] ; then
echo "Checkout needs an argument"
exit 1
else
TAG="$2"
fi
checkout
exit 0
fi
if [ $1 = "bitbake" ]
then
shift
Expand Down Expand Up @@ -426,6 +447,7 @@ echo "Usage: $0 config <machine>"
echo " $0 update"
echo " $0 tag [tagname]"
echo " $0 changelog <tagname>"
echo " $0 checkout <tagname>"
echo " $0 clean"
echo ""
echo " Not recommended, but also possible:"
Expand Down
8 changes: 8 additions & 0 deletions scripts/layerman
Expand Up @@ -90,13 +90,21 @@ function diff_tags() {
echo ""
}

function checkout_tag() {
check_layer
cd ${LAYERDIR} && echo "Checking out $COMMANDARG" && git checkout $COMMANDARG
echo ""
}

case $COMMAND in
tag)
tag_layers;;
changelog)
diff_tags;;
info)
get_info;;
checkout)
checkout_tag;;
*)
update_layers;;
esac

0 comments on commit 26ef55c

Please sign in to comment.