
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`/
  fi

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

