1 #!/bin/sh 2 3 DIRNAME=`dirname "$0"` 4 PROGNAME=`basename "$0"` 5 6 if [ ! "$1" ] || [ "$1" = '--help' ] ; then 7 cat 1>&2 <<EOF 8 Usage: $PROGNAME <output directory> [ -f ] 9 10 Make release archives from tags starting with "rel-" in the repository, 11 storing the archives in the output directory. If an archive already exists for 12 a release, it is not regenerated unless the -f (force) option is given. 13 14 All newly-created archive filenames are emitted on standard output. 15 EOF 16 exit 1 17 fi 18 19 OUTDIR=$1 20 FORCE=$2 21 22 if [ "$FORCE" != '-f' ]; then 23 FORCE= 24 fi 25 26 if [ ! -e "$OUTDIR" ]; then 27 mkdir -p "$OUTDIR" 28 fi 29 30 for TAG in `hg tags | grep ^rel- | cut -f 1 -d ' '` ; do 31 NUM=`echo "$TAG" | sed 's/rel-//;s/-/./g'` 32 OUTFILE="$OUTDIR/imip-agent-$NUM.tar.bz2" 33 if [ ! -e "$OUTFILE" ] || [ "$FORCE" ]; then 34 hg archive -t tbz2 -r "$TAG" "$OUTFILE" 35 echo "$OUTFILE" 36 fi 37 done