X-Git-Url: https://git.distorted.org.uk/~mdw/cfd/blobdiff_plain/b91e23910ae2f433757880fa1c7e7b4a66c586e6..e2b830d2c3955f629b7bfd79f20b687ecde7a2c7:/txtlib.in diff --git a/txtlib.in b/txtlib.in index e8fb938..4db6917 100755 --- a/txtlib.in +++ b/txtlib.in @@ -2,7 +2,7 @@ # -*-sh-*- # -# $Id: txtlib.in,v 1.1 1999/05/05 19:23:47 mdw Exp $ +# $Id: txtlib.in,v 1.4 2003/09/24 22:45:57 mdw Exp $ # # Manipulate simple libraries of text chunks # @@ -30,9 +30,22 @@ #----- Revision history ----------------------------------------------------- # # $Log: txtlib.in,v $ -# Revision 1.1 1999/05/05 19:23:47 mdw -# Initial revision +# Revision 1.4 2003/09/24 22:45:57 mdw +# Support Automake's `aclocal' scheme. Deposit Autoconf fragments in +# `aclocal's' repository. Apply heinous bodging to `txtlib' and +# `mkaclocal'. # +# Revision 1.3 2001/01/20 12:02:12 mdw +# Honour TMPDIR environment variable. +# +# Revision 1.2 1999/11/11 17:49:15 mdw +# Regular expression fixes for parsing version numbers. +# +# Revision 1.1.1.1 1999/05/05 19:23:47 mdw +# New import. The old CVS repository was lost in a disk disaster. +# + +set -e # --- Handle command line arguments --- @@ -64,8 +77,8 @@ EOF exit 0 ;; -v | --v | --ve | --ver | --vers | --versi | --versio | --version) - version=`echo '$Revision: 1.1 $' | - sed -n -e 's;^.*: \([0-9.]*\)\\$;\1;p'` + version=`echo '$Revision: 1.4 $' | + sed -n -e 's;^.*: \([0-9.]*\) *\\$;\1;p'` echo "txtlib $version; Common Files Distribution version @VERSION@" exit 0 ;; @@ -109,10 +122,10 @@ test "$out" = "-" && out="" case $mode in l) - sed -n -e "/^.*\*@-\([-a-zA-Z0-9_]*\)-@\*.*$/ s//\1/p" "$@" + sed -n -e "/^.*\*@-\([-a-zA-Z0-9_]*\)-@\*.*$/ s//\1/p" /dev/null "$@" ;; x) - t=/tmp/txtlib.$$ + t=${TMPDIR-/tmp}/txtlib.$$ if mkdir -m 700 $t; then : else echo >&2 "txtlib: could not create temporary directory" @@ -122,9 +135,9 @@ case $mode in while read LINE; do echo "/\*@-$LINE-@\*/,/\*@-#-@\*/ p" done >$sedfile - test -z "$out" || exec >$out + test -z "$out" || exec >"$out" sed -e '/\*@-[-a-zA-Z0-9_]*-@\*/ i\ - *@-#-@*' "$@" | sed -n -f $sedfile | sed -e '/\*@-#-@\*/ d' + *@-#-@*' /dev/null "$@" | sed -n -f $sedfile | sed -e '/\*@-#-@\*/ d' rm -rf $t ;; esac