diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-05 14:10:22 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-05 14:10:22 +0000 |
commit | c46d04e1b5bd45912be07773c2cd8b82aa7fa01a (patch) | |
tree | bcd6ce013e04845529f963ef0728122071bbfb2c /misc/pascal/zipme | |
parent | e28c2fe16466f245edd80d0f95ff9a5e16f1ca1d (diff) | |
download | nuttx-c46d04e1b5bd45912be07773c2cd8b82aa7fa01a.tar.gz nuttx-c46d04e1b5bd45912be07773c2cd8b82aa7fa01a.tar.bz2 nuttx-c46d04e1b5bd45912be07773c2cd8b82aa7fa01a.zip |
Add config scripts
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@493 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'misc/pascal/zipme')
-rwxr-xr-x | misc/pascal/zipme | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/misc/pascal/zipme b/misc/pascal/zipme new file mode 100755 index 000000000..1d9d87194 --- /dev/null +++ b/misc/pascal/zipme @@ -0,0 +1,71 @@ +#!/bin/sh + +#set -x + +DATECODE=$1 + +TAR="tar cvf" +ZIP=bzip2 + +# Move up one directory + +cd .. +HOME=`pwd` +DIR=${HOME}/pascal +SUBDIR=pascal + +# Make sure we know what is going on + +if [ -z ${DATECODE} ] ; then + echo "You must supply a date code like MMDDYY as a parameter" + exit 1; +fi + +if [ ! -d ${SUBDIR} ] ; then + echo "Directory ${SUBDIR} does not exist." + exit 1; +fi + +if [ ! -x ${SUBDIR}/$0 ] ; then + echo "You must cd to the directory containing this script." + exit 1; +fi + +# Define the ZIP file pathes + +TAR_NAME=${SUBDIR}-${DATECODE}.tar +ZIP_NAME=${TAR_NAME}.bz2 + +# Prepare the directory + +make -C ${SUBDIR} deep-clean + +find ${SUBDIR} -name \*~ -exec rm -f {} \; || \ + { echo "Removal of emacs garbage failed!" ; exit 1 ; } + +find ${SUBDIR} -name \#\* -exec rm -f {} \; || \ + { echo "Removal of emacs garbage failed!" ; exit 1 ; } + +find ${SUBDIR} -name .\*swp\* -exec rm -f {} \; || \ + { echo "Removal of vi garbage failed!" ; exit 1 ; } + +# Remove any previous tarballs + +if [ -f ${TAR_NAME} ] ; then + echo "Removing ${HOME}/${TAR_NAME}" + rm -f ${TAR_NAME} || \ + { echo "rm ${TAR_NAME} failed!" ; exit 1 ; } +fi + +if [ -f ${ZIP_NAME} ] ; then + echo "Removing ${HOME}/${ZIP_NAME}" + rm -f ${ZIP_NAME} || \ + { echo "rm ${ZIP_NAME} failed!" ; exit 1 ; } +fi + +# Then zip it + +${TAR} ${TAR_NAME} ${SUBDIR} || \ + { echo "tar of ${DIR} failed!" ; exit 1 ; } +${ZIP} ${TAR_NAME} || \ + { echo "zip of ${TAR_NAME} failed!" ; exit 1 ; } |