Whamcloud - gitweb
- make HEAD from b_post_cmd3
[fs/lustre-release.git] / lustre / kernel_patches / scripts / sum-series
1 #!/bin/sh
2
3 #
4 # Make superpatch from current series 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: sum-series 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 for FILE in $(cat applied-patches)
27 do
28 #    echo "Adding patch $FILE...."
29         if [ -f $P/patches/$FILE ] 
30         then
31                 cat  $P/patches/$FILE >> $CURRENT
32         elif [ -f $P/patches/$FILE.patch ]
33         then
34                 cat $P/patches/$FILE.patch >> $CURRENT
35         elif [ -f $FILE ]
36         then
37                 cat $FILE >> $CURRENT
38         fi
39 done
40
41 mv $CURRENT "$1"