#!/bin/sh while [ $# -gt 0 ] && [ "${1##-*}" = "" ] && [ "$1" != "" ]; do opts="$opts $1" shift done case $# in 1) ver=`echo $1 | cut -d/ -f1` ;; 2) ver=$2 ;; *|"") echo "Usage: $0 [cvs export options] [module] version" exit 1 ;; esac path=`echo $1/ | cut -d/ -f2-` module=`echo $1 | cut -d- -f1` tag=`echo $ver|sed -e 's/\./_/g'` dir="$ver/`echo $path | sed -e 's%/[^/]*$%%'`" if [ -d $ver ]; then echo "ERROR! Directory $ver already exists" exit 1 fi mkdir -p $dir cvs export -ko $opts -d $dir -r $tag $module/$path