+error_modules=
+cvs_cmd ()
+{
+ dir="$1"
+ module="$2"
+ tag="$3"
+ cotag=""
+ update=""
+
+ if [ "$tag" = "HEAD" ] ; then
+ cotag=""
+ uptag="-A"
+ elif [ "$tag" ] ; then
+ cotag="-r $tag"
+ uptag="-r $tag"
+ else
+ # silently skip if no tag was specified
+ return
+ fi
+
+ # create a cvs date format that will survive shell expansion
+ if [ -n "$pindate" ]; then
+ datecmd=$(date -u +%s -d "$pindate")
+ datecmd="-D @$datecmd"
+ else
+ datecmd=""
+ fi
+
+ if [ -d "$dir" ] ; then
+ echo "$progname: Updating $dir to $tag"
+ ( cd "$dir" && cvs up $datecmd -dAP $uptag )
+ else
+ echo "$progname: Checking out $dir from $tag"
+ cvs co $datecmd -P $cotag -d "$dir" "$module"
+ fi
+ if [ $? != 0 ] ; then
+ error_modules="$dir $error_modules"
+ fi
+}
+
+cvs_cmd build lustre-build "$buildtag"
+
+if [ -f build/buildcvs ] ; then
+ . build/buildcvs
+else
+ fatal 1 "build/buildcvs does not exist; not updating other modules."
+fi
+
+if [ "$error_modules" ] ; then
+ fatal 1 "There were errors checking out the following directories: $error_modules"
+fi