Add option to zipme.sh to provide the build ID on the command line

This commit is contained in:
Gregory Nutt 2013-04-29 08:57:46 -06:00
parent efae204784
commit f16704f5fd
2 changed files with 59 additions and 8 deletions

View File

@ -36,7 +36,7 @@ WD=`pwd`
# Get command line parameters # Get command line parameters
USAGE="USAGE: $0 [-d|-h] [-b build] -v <major.minor> <outfile-path>" USAGE="USAGE: $0 [-d|-h] [-b <build>] -v <major.minor> <outfile-path>"
ADVICE="Try '$0 -h' for more information" ADVICE="Try '$0 -h' for more information"
unset VERSION unset VERSION
@ -62,12 +62,15 @@ while [ ! -z "$1" ]; do
echo $USAGE echo $USAGE
echo "" echo ""
echo "Where:" echo "Where:"
echo " -b <build>"
echo " Use this build identification string. Default: use GIT build ID"
echo " NOTE: GIT build information may not be available in a snapshot"
echo " -d" echo " -d"
echo " Enable script debug" echo " Enable script debug"
echo " -h" echo " -h"
echo " show this help message and exit" echo " show this help message and exit"
echo " -v <major.minor>" echo " -v <major.minor>"
echo " The NuttX version number expressed a major and minor number separated" echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period" echo " by a period"
echo " <outfile-path>" echo " <outfile-path>"
echo " The full path to the version file to be created" echo " The full path to the version file to be created"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# zipme.sh # zipme.sh
# #
# Copyright (C) 2007-2011 Gregory Nutt. All rights reserved. # Copyright (C) 2007-2011, 2013 Gregory Nutt. All rights reserved.
# Author: Gregory Nutt <gnutt@nuttx.org> # Author: Gregory Nutt <gnutt@nuttx.org>
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
@ -35,15 +35,62 @@
#set -x #set -x
WD=`pwd` WD=`pwd`
VERSION=$1
TAR="tar cvf" TAR="tar cvf"
ZIP=gzip ZIP=gzip
# Get command line parameters
USAGE="USAGE: $0 [-d|h] [-b <build]> <major.minor>"
ADVICE="Try '$0 -h' for more information"
unset VERSION
unset BUILD
while [ ! -z "$1" ]; do
case $1 in
-b )
shift
BUILD="-b ${1}"
;;
-d )
set -x
;;
-h )
echo "$0 is a tool for generation of release versions of NuttX"
echo ""
echo $USAGE
echo ""
echo "Where:"
echo " -b <build>"
echo " Use this build identification string. Default: use GIT build ID"
echo " NOTE: GIT build information may not be available in a snapshot"
echo " -d"
echo " Enable script debug"
echo " -h"
echo " show this help message and exit"
echo " <major.minor>"
echo " The NuttX version number expressed as a major and minor number separated"
echo " by a period"
exit 0
;;
* )
break;
;;
esac
shift
done
# The last thing on the command line is the version number
VERSION=$1
# Make sure we know what is going on # Make sure we know what is going on
if [ -z ${VERSION} ] ; then if [ -z ${VERSION} ] ; then
echo "You must supply a version like xx.yy as a parameter" echo "You must supply a version like xx.yy as a parameter"
echo $USAGE
echo $ADVICE
exit 1; exit 1;
fi fi
@ -122,7 +169,8 @@ if [ ! -x "${VERSIONSH}" ]; then
echo "No executable script was found at: ${VERSIONSH}" echo "No executable script was found at: ${VERSIONSH}"
exit 1 exit 1
fi fi
${VERSIONSH} -v ${VERSION} ${NUTTX}/.version || \
${VERSIONSH} ${BUILD} -v ${VERSION} ${NUTTX}/.version || \
{ echo "${VERSIONSH} failed"; cat ${NUTTX}/.version; exit 1; } { echo "${VERSIONSH} failed"; cat ${NUTTX}/.version; exit 1; }
chmod 755 ${NUTTX}/.version chmod 755 ${NUTTX}/.version