Deleted Added
full compact
1c1
< #!/bin/sh
---
> #! /bin/sh
18c18
< # $Id: rcstest,v 5.8 1991/11/20 17:58:10 eggert Exp $
---
> # $Id: rcstest,v 5.14 1995/06/16 06:19:24 eggert Exp $
21c21
< # Copyright 1990, 1991 by Paul Eggert
---
> # Copyright 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
37,38c37,39
< # along with RCS; see the file COPYING. If not, write to
< # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
---
> # along with RCS; see the file COPYING.
> # If not, write to the Free Software Foundation,
> # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
43a45,53
> # The Makefile overrides the following defaults.
> : ${ALL_CFLAGS=-Dhas_conf_h}
> : ${CC=cc}
> : ${DIFF=diff}
> # : ${LDFLAGS=} ${LIBS=} tickles old shell bug
>
> CL="$CC $ALL_CFLAGS $LDFLAGS -o a.out"
> L=$LIBS
>
58,61c68,71
< test -d RCS || {
< echo >&2 "$0: RCS: not a directory; please \`mkdir RCS' first."
< exit 1
< }
---
> if test -d RCS
> then rmdir=:
> else rmdir=rmdir; mkdir RCS || exit
> fi
68,70c78,80
< case `diff -c a.11 a.3x1` in
< *'! 1.1.1.1')
< diff='diff -c';;
---
> case "`$DIFF -c a.11 a.3x1`" in
> *!\ 1.1.1.1)
> diff="$DIFF -c";;
72,73c82,83
< echo "#warning: diff -c does not work, so diagnostics may be cryptic"
< diff=diff
---
> echo "#warning: $DIFF -c does not work, so diagnostics may be cryptic"
> diff=$DIFF
77c87
< <$RCSfile || {
---
> test -r $RCSfile || {
87c97
< <$RCSfile &&
---
> test -r $RCSfile &&
101a112
> rm -f a.c &&
110a122
> rm -f a.c &&
115a128
> rm -f a.c &&
121a135
> rm -f a.c &&
125c139
< <a.c || { echo "#ci -u didn't create a working file"; exit 1; }
---
> test -r a.c || { echo "#ci -u didn't create a working file"; exit 1; }
169,176c183,189
< date=`date -u 2>/dev/null` ||
< date=`TZ=GMT0 date 2>/dev/null` ||
< date=`TZ= date` || exit 2
< set $date
< case $2 in
< Jan) m=01;; Feb) m=02;; Mar) m=03;; Apr) m=04;; May) m=05;; Jun) m=06;;
< Jul) m=07;; Aug) m=08;; Sep) m=09;; Oct) m=10;; Nov) m=11;; Dec) m=12;;
< *) echo >&2 "$0: $2: unknown month name"; exit 2
---
>
>
> # Get the date of the previous revision in UTC.
> date=`rlog -r a.c | sed -n '/^date: /{ s///; s/;.*//; p; q; }'` || exit
> case $date in
> [0-9][0-9][0-9]*[0-9]/[0-1][0-9]/[0-3][0-9]\ [0-2][0-9]:[0-5][0-9]:[0-6][0-9]);;
> *) echo >&2 "$0: $date: bad rlog date output"; exit 1
178,193c191,192
< case $3 in
< ?) d=0$3;;
< *) d=$3
< esac
< case $6 in
< [0-9][0-9][0-9][0-9]*) D=$6/$m/$d;;
< *)
< case $5 in
< [0-9][0-9][0-9][0-9]*) D=$5/$m/$d;;
< *) echo >&2 "$0: bad date format: $date"; exit 2
< esac
< esac
< T=$4
< case $PWD in
< '') PWD=`pwd`
< esac &&
---
> PWD=`pwd` && export PWD &&
> rm -f a.c &&
197,199c196,198
< @Date: $D $T @
< @Header: $PWD$SLASH$RCSfile 2.1 $D $T w s @
< @Id: a.c 2.1 $D $T w s @
---
> @Date: $date @
> @Header: $PWD$SLASH$RCSfile 2.1 $date w s @
> @Id: a.c 2.1 $date w s @
201,202c200,201
< @Log: a.c @
< * Revision 2.1 $D $T w
---
> * @Log: a.c @
> * Revision 2.1 $date w
204a204
> @Name: Oz @
213c213,215
< sed -e '/^\$/!d' -e 's/\$$/: old $/' a.k >a.o &&
---
> sed s/Oz//g a.kv >a.e &&
> sed s/Oz/N/g a.kv >a.N &&
> sed -e '/\$/!d' -e 's/\$$/: old $/' a.k >a.o &&
216c218
< ci -d"$date" -ss -ww -u2.1 -mm $q a.c &&
---
> ci -d"$date" -nOz -ss -ww -u2.1 -mm $q a.c &&
218c220
< co -p -ko $q a.c >a.oo &&
---
> co -pOz -ko $q a.c >a.oo &&
220,221c222,223
< cp a.kv a.o || exit 2
< rcs -o2.1 $q a.c &&
---
> cp a.kv a.o && cp a.o a.b || exit 2
> rcs -oOz $q a.c &&
225c227
< sed '/^[^$]/d' a.kv >a.i &&
---
> sed -n 's/^[^$]*\$/$/p' a.kv >a.i &&
231a234
> rm -f a.c &&
261a265
> rm -f a.c &&
264c268
< $diff a.kv a.c || { echo "#rcs -N failed"; exit 1; }
---
> $diff a.N a.c || { echo "#rcs -N failed"; exit 1; }
265a270
> rm -f a.c &&
267,268c272
< rcs -c':::' $q a.c &&
< echo '$''Log$' >a.c &&
---
> echo ':::$''Log$' >a.c &&
270c274
< test " `sed '$!d' a.c`" = ' :::' || { echo "#rcs -c failed"; exit 1; }
---
> test " `sed '$!d' a.c`" = ' :::' || { echo "#comment leader failed"; exit 1; }
271a276
> rm -f a.c &&
274c279
< $diff a.kv a.c || { echo "#rcs -o failed"; exit 1; }
---
> $diff a.e a.c || { echo "#rcs -o failed"; exit 1; }
276c281
< rcsdiff -r1.1 -r2.1 $q a.c >a.0
---
> rcsdiff -r1.1 -rOz $q a.c >a.0
281c286
< diff a.11 a.kv >a.1
---
> $DIFF a.11 a.kv >a.1
285c290
< for i in k kv kvl o v
---
> for i in b k kv kvl o v
289c294
< rcsdiff -k$i $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; }
---
> rcsdiff -k$i -rOz $q a.c || { echo "#rcsdiff -k$i failed"; exit 1; }
295a301,315
> rcsclean $q a.c &&
> rcsclean -u $q a.c || { echo "#rcsclean botched a nonexistent file"; exit 1; }
>
> rm -f a.c &&
> co $q a.c &&
> rcsclean -n $q a.c &&
> rcsclean -n -u $q a.c &&
> test -f a.c || { echo "#rcsclean -n removed a file"; exit 1; }
>
> rm -f a.c &&
> co $q a.c &&
> rcsclean $q a.c &&
> test ! -f a.c || { echo "#rcsclean missed an unlocked file"; exit 1; }
>
> rm -f a.c &&
296a317,332
> rcsclean $q a.c &&
> test -f a.c || { echo "#rcsclean removed a locked file"; exit 1; }
> rcsclean -u $q a.c &&
> test ! -f a.c || {
> echo "#rcsclean -u missed an unchanged locked file"; exit 1;
> }
>
> rm -f a.c &&
> co -l $q a.c &&
> echo change >>a.c &&
> rcsclean $q a.c &&
> rcsclean $q -u a.c &&
> test -f a.c || { echo "#rcsclean removed a changed file"; exit 1; }
>
> rm -f a.c &&
> co -l $q a.c &&
327c363
< rcsmerge -r2.2 -r2.3 $q a.c
---
> rcsmerge -E -r2.2 -r2.3 $q a.c
346,347c382,403
< nl='
< '
---
> # Avoid `tr' if possible; it's not portable, and it can't handle null bytes.
> # Our substitute exclusive-ORs with '\n';
> # this ensures null bytes on output, which is even better than `tr',
> # since some diffs think a file is binary only if it contains null bytes.
> cat >a.c <<'EOF'
> #include <stdio.h>
> int main() {
> int c;
> while ((c=getchar()) != EOF)
> putchar(c ^ '\n');
> return 0;
> }
> EOF
> tr=tr
> if (rm -f a.exe a.out && $CL a.c $L >&2) >/dev/null 2>&1
> then
> if test -s a.out
> then tr=./a.out
> elif test -s a.exe
> then tr=./a.exe
> fi
> fi
349c405
< co -p $q a.c | tr "$nl" '\200' >a.24 &&
---
> co -p $q a.c | $tr '\012' '\200' >a.24 &&
355c411
< co -p $q a.c | tr '\200' "$nl" >a.c &&
---
> co -p $q a.c | $tr '\200' '\012' >a.c &&
380a437
> Oz: 2.1
382d438
< comment leader: ":::"
389c445
< date: $D $T; author: w; state: s; lines: +13 -1
---
> date: $date; author: w; state: s; lines: +14 -1
397c453,454
< exec rm -f a.* $RCSfile $RCS_alt
---
> rm -f a.* $RCSfile $RCS_alt
> $rmdir RCS