Debian Codegraph @

debian/viewpatch

raw
1 #!/bin/sh
2 ##
3 #
4 # (C) Roger Gammans 2001 ([email protected]).
5 #
6 # Please distribute under the GPL.
7 #
8 # It's probably better to rely on the $PATH
9 # to find the various external bits as they more likey
10 # to be in it somewhere than one particluar location
11 # over many unices.
12 #
13
14 FNAME=`tempfile` || { echo "$0: Cannot create temporary file" >&2; exit 1; }
15 trap " [ -f \"$FNAME\" ] && /bin/rm -f -- \"$FNAME\"" 0 1 2 3 13 15
16
17 ORIG=$1
18 PATCH=$2
19
20 shift 2
21
22 if [ -z "$ORIG" ] || [ ! -e "$ORIG" ] ; then
23 echo "$0: original file '$ORIG' does not exist"
24 fi
25 if [ -z "$PATCH" ] || [ ! -e "$PATCH" ] ; then
26 echo "$0: original file '$ORIG' does not exist"
27 fi
28
29
30 cp $ORIG $FNAME;
31 if patch $* $FNAME < $PATCH; then mgdiff $ORIG $FNAME; fi
32
33 exit 0