Whamcloud - gitweb
Revert "b=19325 adjust waiting extent locks during 1st enqueue"
[fs/lustre-release.git] / lustre / kernel_patches / scripts / fpatch
1 #!/bin/sh
2
3 #
4 # Add a file to a patch.
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: fpatch patchname filename"
16         echo "       fpatch filename"
17         exit 1
18 }
19
20 if [ $# == 1 ]
21 then
22         PATCH_NAME=$(top_patch)
23         FILENAME=$1
24 elif [ $# == 2 ]
25 then
26         PATCH_NAME=$(stripit $1)
27         FILENAME=$2
28 else
29         usage
30 fi
31
32
33 if is_applied_last $PATCH_NAME
34 then
35         true
36 else
37         if is_applied $PATCH_NAME
38         then
39                 echo $PATCH_NAME is not the last-applied patch
40                 exit 1
41         else
42                 echo $PATCH_NAME >> $DB
43         fi
44 fi
45
46 if file_in_patch $FILENAME $PATCH_NAME
47 then
48         echo File $FILENAME is already in patch $PATCH_NAME
49         exit 1
50 fi
51
52 install_file_in_patch $FILENAME $PATCH_NAME
53