Whamcloud - gitweb
Revert "b=19325 adjust waiting extent locks during 1st enqueue"
[fs/lustre-release.git] / lustre / kernel_patches / scripts / combine-applied
1 #!/bin/sh
2
3 #
4 # Make superpatch from currently applied patches using combinediff.
5 #
6
7 . patchfns >/dev/null || . /usr/lib/patch-scripts/patchfns >/dev/null || { \
8         echo "Impossible to find my library 'patchfns'."
9         echo "Check your install, or go to the right directory"
10         exit 1
11 }
12
13 usage()
14 {
15         echo "Usage: combine-applied output-file"
16         exit 1
17 }
18
19 if [ $# -ne 1 ] 
20 then
21         usage
22 fi
23
24 need_file_there applied-patches
25 CURRENT=$(mktemp /tmp/cmbd-XXXXXXXX)
26 APPLY_FILE=$(mktemp /tmp/cmbd-XXXXXXXX)
27 for FILE in `cat applied-patches`
28 do
29         if [ -f $P/pc/$FILE.pc ]
30         then
31                 cat $P/pc/$FILE.pc >> $CURRENT  
32         elif [ -f $P/pc/$FILE ]
33         then
34                 cat $P/pc/$FILE >> $CURRENT     
35         fi      
36 done
37 cat $CURRENT | sort -u > $APPLY_FILE
38 echo > $1
39 for FILE in `cat $APPLY_FILE`
40 do
41         diff -uNp $FILE~orig $FILE >> $1 
42 done
43 rm -rf $APPLY_FILE 
44 rm -rf $CURRENT
45