#!/bin/sh

REV=$1
OS_EXT=$2
COMPANY_EXT=$3

echo $OS_EXT


echo $COMPANY_EXT

MAJOR_VERSION=rcts-3.5.0

SVNURL=http://svn.solbox.com/svn/interactive

if [ $# -lt 3 ]
then
        echo "$0 [REVISONNUM] [OS EXT] [COMPANY EXT]"
        echo "REVISONNUM : Maximum revision of applications."
        echo "	ex)  R0697"
        echo "OS EXT : _CentOS5.4."
        echo "COMPANY EXT :  CC Nmame"
        exit 1
fi


rm -rf rcts*$COMPANY_EXT
WORK_PATH="/root/work/files/$MAJOR_VERSION.${REV}_$COMPANY_EXT/"
SVN_SH="/root/work/files/getlastsvn.sh"
mkdir -p $WORK_PATH

$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_du" "$WORK_PATH" "rc_du" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_rmcd" "$WORK_PATH" "rc_rmcd" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_mngd" "$WORK_PATH" "rc_mngd" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_mond" "$WORK_PATH" "rc_mond" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_mond" "$WORK_PATH" "rc_show" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_sscd" "$WORK_PATH" "rc_sscd" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_syncd" "$WORK_PATH" "rc_syncd" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_syncd" "$WORK_PATH" "diff_com.sh" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_cmove" "$WORK_PATH" "rc_cmove" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_cmove" "$WORK_PATH" "psql" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_cmove" "$WORK_PATH" "rc_cmovegen.sh" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_gcmd" "$WORK_PATH" "rc_gcmd" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/logmngd" "$WORK_PATH" "logmngd" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/rcts/rc_balanced" "$WORK_PATH" "rc_balanced" "" "$OS_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/conf" "$WORK_PATH" "postconfig" "" "$COMPANY_EXT"
$SVN_SH "FILE" "$SVNURL" "/tags/release/conf" "$WORK_PATH" "rcts.conf.in" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/installsh" "$WORK_PATH" "rcts_ctl" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/installsh" "$WORK_PATH" "rcts_config.sh" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/installsh" "$WORK_PATH" "sysctl_config_rcts.sh" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/conf" "$WORK_PATH" "rc_sscd.sql" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/conf" "$WORK_PATH" "rc_mmngd_CA.pem" "" ""
$SVN_SH "FILE" "$SVNURL" "/tags/release/conf" "$WORK_PATH" "rc_mmngd_privkey.pem" "" ""
