Whamcloud - gitweb
LU-10756 ptlrpc: fix IMP_CLOSED state is being never set
[fs/lustre-release.git] / contrib / scripts / confirmpatches.sh
1 #!/bin/bash
2 PROG=$(basename $0)
3 [ "$1" = "-h" -o "$1" = "--help" ] && echo "usage: $PROG [patch dir]" && exit 0
4 [ "$1" = "-v" ] && shift && VERBOSE="echo" || VERBOSE=":"
5
6 [ "$1" ] && BASEDIR="$1"
7 BASEDIR=${BASEDIR:-lustre/kernel_patches}
8 SERIESPATH=${SERIESPATH:-$BASEDIR/series}
9 PATCHPATH=${PATCHPATH:-$BASEDIR/patches}
10
11 [ ! -d "$BASEDIR" ] && echo "$PROG: missing base directory '$BASEDIR'" && exit 1
12 [ ! -d "$SERIESPATH" ] && echo "$PROG: missing series '$SERIESPATH'" && exit 2
13 [ ! -d "$PATCHPATH" ] && echo "$PROG: missing patches '$PATCHPATH'" && exit 3
14
15 for SERIES in $(ls $SERIESPATH | egrep -v "~$|.orig|.rej") ; do
16         $VERBOSE "series: $SERIES"
17         for PATCH in $(grep -v "^#" $SERIESPATH/$SERIES); do
18                 $VERBOSE $PATCH
19                 if [ ! -e $PATCHPATH/$PATCH ]; then
20                         echo "$SERIESPATH/$SERIES: patch '$PATCH' not found!"
21                 fi
22         done
23 done