summaryrefslogtreecommitdiff
path: root/nuttx/tools
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-06-10 02:24:53 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2007-06-10 02:24:53 +0000
commita757e1e1b5123eab32d043e42e6bd03f25c90bf8 (patch)
treea9a01ecec20666fde541009d479f235adad96532 /nuttx/tools
parentd7e8c31e2f62380e353485a40bea5b52ed7e4547 (diff)
downloadpx4-nuttx-a757e1e1b5123eab32d043e42e6bd03f25c90bf8.tar.gz
px4-nuttx-a757e1e1b5123eab32d043e42e6bd03f25c90bf8.tar.bz2
px4-nuttx-a757e1e1b5123eab32d043e42e6bd03f25c90bf8.zip
Force directory name to be nuttx-xx.yy.zz
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@284 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/tools')
-rwxr-xr-xnuttx/tools/zipme.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/nuttx/tools/zipme.sh b/nuttx/tools/zipme.sh
index 5919edddb..382305d68 100755
--- a/nuttx/tools/zipme.sh
+++ b/nuttx/tools/zipme.sh
@@ -35,7 +35,7 @@
#set -x
WD=`pwd`
-DATECODE=$1
+VERSION=$1
TAR="tar cvf"
ZIP=gzip
@@ -55,11 +55,14 @@ GARBAGEDIRS="\
# Make sure we know what is going on
-if [ -z ${DATECODE} ] ; then
+if [ -z ${VERSION} ] ; then
echo "You must supply a version like xx.yy.zz as a parameter"
exit 1;
fi
+# Find the directory we were executed from and were we expect to
+# see the directory to tar up
+
MYNAME=`basename $0`
if [ -x ${WD}/${MYNAME} ] ; then
@@ -68,23 +71,32 @@ else
if [ -x ${WD}/tools/${MYNAME} ] ; then
NUTTX=${WD}
else
- echo "You must cd NUTTX directory to execute this script."
+ echo "You must cd into the NUTTX directory to execute this script."
exit 1
fi
fi
+# Get the NuttX directory name and the path to the parent directory
+
NUTTXDIR=`basename ${NUTTX}`
PROJECTS=`dirname ${NUTTX}`
+# The name of the directory must match the version number
+
+if [ "X$NUTTXDIR" != "Xnuttx-${VERSION}" ]; then
+ echo "Expected directory name to be nuttx-${VERSION} found ${NUTTXDIR}"
+ exit 1
+fi
+
cd ${PROJECTS} || \
{ echo "Failed to cd to ${PROJECTS}" ; exit 1 ; }
if [ ! -d ${NUTTXDIR} ] ; then
echo "${PROJECTS}/${NUTTXDIR} does not exist!"
- exit 1;
+ exit 1
fi
-TAR_NAME=nuttx-${DATECODE}.tar
+TAR_NAME=nuttx-${VERSION}.tar
ZIP_NAME=${TAR_NAME}.gz
# Prepare the nuttx directory -- Remove editor garbage