3 [ "$1" = "-h" -o "$1" = "--help" ] && echo "usage: $PROG [patch dir]" && exit 0
4 [ "$1" = "-v" ] && shift && VERBOSE="echo" || VERBOSE=":"
6 [ "$1" ] && BASEDIR="$1"
7 BASEDIR=${BASEDIR:-lustre/kernel_patches}
8 SERIESPATH=${SERIESPATH:-$BASEDIR/series}
9 PATCHPATH=${PATCHPATH:-$BASEDIR/patches}
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
15 for SERIES in $(ls $SERIESPATH | egrep -v "~$|.orig|.rej") ; do
16 $VERBOSE "series: $SERIES"
17 for PATCH in $(grep -v "^#" $SERIESPATH/$SERIES); do
19 if [ ! -e $PATCHPATH/$PATCH ]; then
20 echo "$SERIESPATH/$SERIES: patch '$PATCH' not found!"