head	1.1;
access;
symbols;
locks; strict;
comment	@# @;


1.1
date	2001.06.15.20.49.36;	author stack;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Add script to upgraded CVSROOT config file.
@
text
@#!/bin/sh
##
## Convert the file at ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config
## to new format.  File format was changed from:
##
##    MysqlUser=tigris
##    MysqlPasswd=euphrates
##    MysqlDB=tigris
##    MysqlDefaultUser=tigrisc
##    MysqlPasswdTable=User
##    MysqlUsernameCol=loginID
##    MysqlPasswdCol=password
##    MysqlEncrypt=mysql
##    LockDir=/usr/local/tigris/data/helm/cvs/lock
##
## to:
##
##    LockDir=/usr/local/tigris/data/helm/cvs/lock
##
## Save old versions of config.in and config aside w/ a preTIGRIS_1_0_0
## suffix.
##
## $Id: dump_tigris_db.sh,v 1.4 2001/06/01 16:53:22 stack Exp $
## 


## Check we've sourced a wholesome env.sh
##
function checkEnv
{
    if [ ! -n "${SANDBOX}" \
            -o ! -d "${SANDBOX}" \
            -o ! -e "${SANDBOX}/scripts/env.sh"  ]
    then
        echo "ERROR: SANDBOX is undefined or is not an extant dir."
        exit 1
    fi

    "${SANDBOX}/scripts/env_check" &> /dev/null
    if [ $? -ne 0 ]
    then
        echo "ERROR: ${SANDBOX}/scripts/env_check failed."
        echo "ERROR: Is env.sh set properly?"
        exit 1
    fi
}


## Script execution starts here.
##
checkEnv

mv ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config.in \
    ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config.in.preTIGRIS_1_0_0
cp ${SANDBOX}/helm/data/cvs/repository/CVSROOT/config.in \
    ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config.in
chown tigrisc:tigris \
    ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config.in

mv ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config \
    ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config.preTIGRIS_1_0_0
sed --expression='s|__SANDBOX__|'"$SANDBOX"'|' \
    ${SANDBOX}/helm/data/cvs/repository/CVSROOT/config.in \
    > ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config
chown tigrisc:tigris \
    ${SANDBOX}/data/helm/cvs/repository/CVSROOT/config
@
