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 if [ ! "$1" ] || [ "$1" = '--help' ] ; then 7 cat 1>&2 <<EOF 8 Usage: $PROGNAME <archive directory> [ -f ] 9 10 Sign archives in the given archive directory, invoking GPG to produce a 11 detached signature. If a signature already exists for an archive, it is not 12 regenerated unless the -f (force) option is given. 13 14 All newly-created signature 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 cat 1>&2 <<EOF 28 No archive directory to process. 29 EOF 30 exit 1 31 fi 32 33 for FILENAME in "$OUTDIR/"*".tar.bz2" ; do 34 OUTFILE="$FILENAME.asc" 35 if [ ! -e "$OUTFILE" ] || [ "$FORCE" ]; then 36 gpg --sign -a -b "$FILENAME" 37 echo "$OUTFILE" 38 fi 39 done