X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=build%2Fconfirmpatches.sh;h=7531aa1ca67338c2a5068009e0942143f87e908e;hb=a3a4ecdd28c2cbb41e1245479c918e9e9fcfabaa;hp=c9cb6993c9d70ec783d0876f1ddd3ae859075ceb;hpb=78c99153146f26dd15174ceff7f15acdf58dc52f;p=fs%2Flustre-release.git diff --git a/build/confirmpatches.sh b/build/confirmpatches.sh old mode 100644 new mode 100755 index c9cb699..7531aa1 --- a/build/confirmpatches.sh +++ b/build/confirmpatches.sh @@ -1,11 +1,23 @@ -SERIESPATH=./series -PATCHESPATH=./patches -for SERIES in `ls $SERIESPATH | egrep -v "CVS|~$|.orig"` ; do - #echo $SERIES - for PATCH in `cat $SERIESPATH/$SERIES`; do - #echo $PATCH - if [ ! `find $PATCHESPATH -name $PATCH` ]; then - echo "$SERIESPATH/$SERIES: patch $PATCH was not found !" +#!/bin/bash +PROG=$(basename $0) +[ "$1" = "-h" -o "$1" = "--help" ] && echo "usage: $PROG [patch dir]" && exit 0 +[ "$1" = "-v" ] && shift && VERBOSE="echo" || VERBOSE=":" + +[ "$1" ] && BASEDIR="$1" +BASEDIR=${BASEDIR:-lustre/kernel_patches} +SERIESPATH=${SERIESPATH:-$BASEDIR/series} +PATCHPATH=${PATCHPATH:-$BASEDIR/patches} + +[ ! -d "$BASEDIR" ] && echo "$PROG: missing base directory '$BASEDIR'" && exit 1 +[ ! -d "$SERIESPATH" ] && echo "$PROG: missing series '$SERIESPATH'" && exit 2 +[ ! -d "$PATCHPATH" ] && echo "$PROG: missing patches '$PATCHPATH'" && exit 3 + +for SERIES in $(ls $SERIESPATH | egrep -v "~$|.orig|.rej") ; do + $VERBOSE "series: $SERIES" + for PATCH in $(grep -v "^#" $SERIESPATH/$SERIES); do + $VERBOSE $PATCH + if [ ! -e $PATCHPATH/$PATCH ]; then + echo "$SERIESPATH/$SERIES: patch '$PATCH' not found!" fi done done