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