Whamcloud - gitweb
Use sendmail and set the sender address to ensure that mail is not sent from a
[fs/lustre-release.git] / build / land1.sh
index 6b69eae..274eec6 100755 (executable)
@@ -27,10 +27,10 @@ CHILD=`echo $child | sed -e "s/^b_//" | tr "[a-z]" "[A-Z]"`
 date=`date +%Y%m%d_%H%M`
 
 dir=${3:-.}
-module=$(<$dir/CVS/Repository)
+module=$(basename $(<$dir/CVS/Repository))
 
 if [ "$module" = "lustre" ] ; then
-    echo >&2 "${progname}: You probably want to branch lustre or portals, not the whole tree."
+    echo >&2 "${progname}: You probably want to land lustre or portals, not the whole tree."
     echo >&2 "${progname}: Try using ${0} $parent $child lustre"
     exit 1
 fi
@@ -55,7 +55,7 @@ TEST_FILE=${TEST_FILE:-ChangeLog} # does this need to be smarter?
 check_tag() {
        [ -z "$1" ] && echo "check_tag() missing arg" && exit3
        [ "$1" = "HEAD" ] && return
-       $CVS log $dir/$TEST_FILE 2> /dev/null | grep -q "       $1: " && return
+       $CVS log ${dir%%/*}/$TEST_FILE 2> /dev/null | grep -q " $1: " && return
        echo "${progname}: tag $1 not found in $dir/$TEST_FILE"
        exit 2
 }
@@ -106,7 +106,8 @@ $CVS update -j ${CHILD}_BASE -j ${PARENT}_${CHILD}_LAND_CHILD_$date $dir
 echo "done"
 
 echo -n "Recording conflicts in $CONFLICTS ..."
-if $CVS update | grep '^C' > $CONFLICTS; then
+$CVS update | awk '/^C/ { print $2 }' > $CONFLICTS
+if [ -s $CONFLICTS ] ; then
     echo "Conflicts found, fix before committing."
     cat $CONFLICTS
 else