#!/bin/bash
#=========================================================================
# Copyright (C) GemTalk Systems 1986-2020.  All Rights Reserved..
#
# This script bootstraps Glass into GemStone
#
#=========================================================================
if [ -s $GEMSTONE/seaside/etc/gemstone.secret ]; then
    . $GEMSTONE/seaside/etc/gemstone.secret
else
    echo 'Missing password file $GEMSTONE/seaside/etc/gemstone.secret'
    exit 1
fi

export upgradeDir=$GEMSTONE/upgrade

$GEMSTONE/bin/topaz -l -T200000 <<EOF

set user SystemUser pass $GEMSTONE_CURATOR_PASS gems $GEMSTONE_NAME
login
run
"Use Legacy Streams and Unicode mode"
Stream installLegacyStreamImplementation.
(Globals at: #'PositionableStream_position') == #'ANSI'
   ifTrue: [
     Globals at: #'PositionableStream_position' put: #'Legacy'.
     PositionableStream compilePositionMethods ].
Globals at: #StringConfiguration put: Unicode16.
true
%

! install Cypress support --- this will evenutally be done in the base filein, but limit it to seaside
!   extent for the time being (bug 44636)
input $upgradeDir/bootstrapCypressSupport.topaz

commit
logout


set user DataCurator pass $GEMSTONE_CURATOR_PASS gems $GEMSTONE_NAME
login
errorCount

input $upgradeDir/installMaster30.topaz

commit

logout
errorCount
exit
EOF

