
branches=$*

if test "${branches}" = "" ; then
  echo "No branch are specified to export"
else
  cd ..
  root=`pwd`
  version=`basename ${root}`
  package=`dirname ${root}`
  package=`basename ${package}`

  if test ${package} = "CMT" ; then
    prefix=`cmt version`/
##  else
##    prefix=${package}/
  fi

  cd ../../
  branches=`echo " "${branches} | sed -e "s%[ ]% ${package}/${version}/%g"`
  tar cf ${package}/${package}${version}.tar ${branches}
  compress ${package}/${package}${version}.tar
  ${CMTROOT}/mgr/cmt_export.sh ${package} ${package}/${package}${version}.tar.Z ${prefix}
fi

