X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=build%2Fbranch.sh;h=0b9b1cd2cc1d12dda74a36b33b2fef4db6eddf1a;hp=64c702e39a93e60c946cbd91c673bb367fb40dcf;hb=7605640b70abc07b10c71a97432fa3a1309e627a;hpb=cbb454150790aceec1153749302cb6e8f4449f1d diff --git a/build/branch.sh b/build/branch.sh index 64c702e..0b9b1cd 100755 --- a/build/branch.sh +++ b/build/branch.sh @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e CVS=${CVS:-cvs} progname=${0##*/} @@ -12,10 +12,14 @@ parent=$1 child=$2 CHILD=`echo $child | sed -e "s/^b_//" | tr "[a-z]" "[A-Z]"` dir=${3:-.} +if [ ! -d $dir ]; then + echo >&2 "${progname}: directory '$dir' does not exist." + exit 1 +fi module=$(basename $(<$dir/CVS/Repository)) -if [ "$module" = "lustre" ] ; then - echo >&2 "${progname}: You probably want to branch lustre or portals." +if [ "$module" = "lustre" ]; then + echo >&2 "${progname}: You probably want to branch lustre or lnet." echo >&2 "${progname}: Try using ${0} $parent $child lustre" exit 1 fi @@ -31,10 +35,13 @@ case $child in *) child="b_$child" esac -if [ "$parent" != "HEAD" -a "`cat $dir/CVS/Tag`" != "T$parent" ]; then - echo "This script must be run within the $parent branch" - exit 1 -fi +#if [ "$parent" != "HEAD" -a -f $dir/CVS/Tag ]; then + # put in separate condition as bash evaluates all conditions unlike C +# if [ "`cat $dir/CVS/Tag`" != "T$parent" ]; then +# echo "This script must be run within the $parent branch" +# exit 1 +# fi +#fi echo parent: $parent CHILD: $CHILD child: $child date: $date