#!/bin/sh -f

if test $# -lt 2 ; then
  echo "Usage : " 1>&2
  echo "> cmt_export.sh <Package> <file> [<prefix>]" 1>&2
  exit 1
fi

package=$1
file=$2

if test $# = 3 ; then
  prefix=$3
else
  prefix=
fi

echo "> cmt_export.sh ${package} ${file} ${prefix}"

if test "${FTPPATH}" = "" ; then
  dest=/www/Web/htdocs/html/SI/${package}/${prefix}
else
  dest="${FTPPATH}"
fi

if test ! -d ${dest} ; then
  mkdir -p ${dest}
fi

unset noclobber

echo "> cp ${file} ${dest}"
cp -R ${file} ${dest}
##if test ! `pwd` = `(cd ${dest}; pwd)` ; then
##  /bin/rm -f ${file}
##fi


