comparison lib-src/vcdiff @ 5491:06dd936cde16

Merge some stuff in lib-src -------------------- ChangeLog entries follow: -------------------- lib-src/ChangeLog addition: 2010-02-19 Ben Wing <ben@xemacs.org> * digest-doc.c: * digest-doc.c (main): * emacs.csh: * hexl.c: * hexl.c (Gabryelski): * hexl.c (main): * hexl.c (usage): * sorted-doc.c: * sorted-doc.c (fatal): * sorted-doc.c (xstrdup): * sorted-doc.c (main): * vcdiff: Merge up to FSF 23.1.92.
author Ben Wing <ben@xemacs.org>
date Fri, 19 Feb 2010 22:13:17 -0600
parents 376386a54a3c
children
comparison
equal deleted inserted replaced
5030:422b4b4fb2a6 5491:06dd936cde16
1 #!/bin/sh 1 #! /bin/sh
2 # 2
3 # Enhanced sccs diff utility for use with vc mode. 3 # Enhanced sccs diff utility for use with vc mode.
4 # This version is more compatible with rcsdiff(1). 4 # This version is more compatible with rcsdiff(1).
5 # 5
6 # !Id: vcdiff,v 1.4 1993/12/03 09:29:18 eggert Exp ! 6 # Copyright (C) 1992, 1993, 1995, 1997, 2001, 2002, 2003, 2004, 2005,
7 # 7 # 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
8
9 # Author: Paul Eggert
10 # (according to authors.el)
11
12 # This file is part of XEmacs.
13
14 # XEmacs is free software: you can redistribute it and/or modify
15 # it under the terms of the GNU General Public License as published by
16 # the Free Software Foundation, either version 3 of the License, or
17 # (at your option) any later version.
18
19 # XEmacs is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU General Public License for more details.
23
24 # You should have received a copy of the GNU General Public License
25 # along with XEmacs. If not, see <http://www.gnu.org/licenses/>.
26
8 # Modified by: vladimir@Eng.Sun.COM on 95-06-07 27 # Modified by: vladimir@Eng.Sun.COM on 95-06-07
9 # * Made sure that file arguments are specifed as s.<filename>. 28 # * Made sure that file arguments are specifed as s.<filename>.
10 # * Switched the assignments to $f inside the 3rd and 4th case statements of 29
11 # the first for-loop 30 # Synced up with: GNU 23.1.92.
12 # * Removed the incorrect initialization of sid1 before the first for-loop. 31 # Synced by: Ben Wing, 2-17-10.
13 # 32
14 33
15 DIFF="diff" 34 DIFF="diff"
16 usage="$0: Usage: vcdiff [--brief] [-q] [-r<sid1>] [-r<sid2>] [diffopts] sccsfile..." 35 usage="$0: Usage: vcdiff [--brief] [-q] [-r<sid1>] [-r<sid2>] [diffopts] sccsfile..."
17 36
18 PATH=$PATH:/usr/ccs/bin:/usr/sccs # common SCCS hangouts 37 # Now that we use `sccs get' rather than just `get', we don't need this.
38 # PATH=$PATH:/usr/ccs/bin:/usr/sccs:/usr/xpg4/bin # common SCCS hangouts
19 39
20 echo= 40 echo="echo"
21 sid1= sid2= 41 sid1= sid2=
22 42
23 for f 43 for f
24 do 44 do
25 case $f in 45 case $f in
29 DIFF=cmp;; 49 DIFF=cmp;;
30 -q) 50 -q)
31 echo=:;; 51 echo=:;;
32 -r?*) 52 -r?*)
33 case $sid1 in 53 case $sid1 in
34 -r*) 54 '')
35 sid2=$f 55 sid1=$f
36 ;; 56 ;;
37 *) 57 *)
38 case $sid2 in 58 case $sid2 in
39 ?*) echo "$usage" >&2; exit 2 ;; 59 ?*) echo "$usage" >&2; exit 2 ;;
40 esac 60 esac
41 sid1=$f 61 sid2=$f
42 ;; 62 ;;
43 esac 63 esac
44 ;; 64 ;;
45 *) 65 *)
46 options="$options $f" 66 options="$options $f"
65 trap 'status=2; exit' 1 2 13 15 85 trap 'status=2; exit' 1 2 13 15
66 trap 'rm -f $rev1 $rev2 || status=2; exit $status' 0 86 trap 'rm -f $rev1 $rev2 || status=2; exit $status' 0
67 87
68 for f 88 for f
69 do 89 do
70 s=2 90 s=2
71 91
72 # For files under SCCS control, fixup the file name to be the s. filename 92 # For files under SCCS control, fixup the file name to be the
73 if [ -d SCCS ]; then 93 # s. filename
74 if [ $f = `echo $f | sed -e 's|SCCS/s.||'` ]; then 94 if [ -d SCCS ]; then
75 f="SCCS/s.$f" 95 if [ $f = `echo $f | sed -e 's|SCCS/s.||'` ]; then
76 fi 96 f="SCCS/s.$f"
77 fi 97 fi
98 fi
78 99
79 case $f in 100 case $f in
80 s.* | */s.*) 101 s.* | */s.*)
81 if 102 if
82 rev1=/tmp/geta$$ 103 rev1=`mktemp /tmp/geta.XXXXXXXX`
83 get -s -p -k $sid1 "$f" > $rev1 && 104 sccs get -s -p -k $sid1 "$f" > $rev1 &&
84 case $sid2 in 105 case $sid2 in
85 '') 106 '')
86 workfile=`expr " /$f" : '.*/s.\(.*\)'` 107 workfile=`expr " /$f" : '.*/s.\(.*\)'`
87 ;; 108 ;;
88 *) 109 *)
89 rev2=/tmp/getb$$ 110 rev2=`mktemp /tmp/getb.XXXXXXXX`
90 get -s -p -k $sid2 "$f" > $rev2 111 sccs get -s -p -k $sid2 "$f" > $rev2
91 workfile=$rev2 112 workfile=$rev2
92 esac 113 esac
93 then 114 then
94 $echo $DIFF $options $sid1 $sid2 $workfile >&2 115 $echo $DIFF $options $rev1 $workfile >&2
95 $DIFF $options $rev1 $workfile 116 $DIFF $options $rev1 $workfile
96 s=$? 117 s=$?
97 fi 118 fi
98 ;; 119 ;;
99 *) 120 *)
102 123
103 if test $status -lt $s 124 if test $status -lt $s
104 then status=$s 125 then status=$s
105 fi 126 fi
106 done 127 done
128
129 # arch-tag: 4344ba3a-bcbe-4f77-971c-f43c1606953a