2019-05-20 | Paul Boddie | raw annotate files changeset graph | Experiment with a temporary attribute on objects. This attribute must be cleared when assignments occur, but it should also be cleared when objects escape from functions (which is not yet done). Since the motivation for marking objects as temporary is their re-use in certain operations, the objective is to avoid objects being used in multiple places and still being marked as temporary and potentially undergoing re-use/mutation. Perhaps the only way of guaranteeing exclusive access to an object is if it is provided as a function result and is immediately passed to a function or operation, with this function either mutating the object or ensuring its direct propagation to another such function. | temporary-object-experiment |
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