Whamcloud - gitweb
- make HEAD from b_post_cmd3
[fs/lustre-release.git] / lustre / kernel_patches / scripts / ptkdiff
1 #!/bin/sh
2
3 #
4 # Bring up a patched file in tkdiff.  We show the diffs
5 # in the topmost patch, unless it was specified
6 #
7
8 . patchfns >/dev/null || . /usr/lib/patch-scripts/patchfns >/dev/null || { \
9         echo "Impossible to find my library 'patchfns'."
10         echo "Check your install, or go to the right directory"
11         exit 1
12 }
13
14 usage()
15 {
16         echo "Usage: ptkdiff filename ..."
17         echo "       ptkdiff -"
18         exit 1
19 }
20
21 PATCH_NAME=$(top_patch)
22
23 doit()
24 {
25         filename=$1
26         unpatched_file=$filename"~"$PATCH_NAME
27         need_file_there $filename
28         if [ -e $unpatched_file ]
29         then
30                 tkdiff $unpatched_file $filename
31         else
32                 echo ptkdiff: $filename appears to not be in $PATCH_NAME
33         fi
34 }
35
36 if [ x"$1" = "x-" ]
37 then
38         FILENAME=$(cat $P/pc/$PATCH_NAME.pc)
39 else
40         FILENAME="$*"
41 fi
42
43 for i in $FILENAME
44 do
45         doit $i &
46 done