I'll modify the ant targets as necessary.
The script breaks when the following occurs:
In do-daily-updates.sh, kupdate is called (the shared-functions file having been sourced).
kupdate generates a properties file called, appropriately, "generated-build.properties" by calling ksetprops
kupdate then calls kcheckout and then...
kupdate calls kant
kant calls ant with a target of import, passing it the following argument: -Dgenerated.properties.file=/home/j2eemgr/kuali/generated-build.properties
ant uses the default build file in kul-cfg-envs and executes the import target which then calls other ant targets:
<target name="init-base-properties">
<property file="$
{generated.properties.file}
" />
<property file="$
{application.working.directory}
/build.properties" />
<property file="$
{working.directory}
/build.properties" />
<property file="$
{application.deploy.directory}
/build.properties" />
<condition property="import.into.mysql">
<equals arg1="$
{datasource.ojb.platform}
" arg2="MySQL" />
</condition>
</target>
<!-- note: init-mysql-properties depends upon init-base-properties -->
<target name="init-properties" depends="init-mysql-properties">
<property file="$
{oracle.impex.properties.file}
" />
<loadfile property="impex-build.properties" srcfile="$
{impex.properties.file.template}
"><filterchain><expandproperties /></filterchain></loadfile>
<delete file="$
{impex.properties.file}" />
<echo message="${impex-build.properties}" file="${impex.properties.file}
" />
</target>
<!-- note: create-mysql user depends upon init-properties -->
<target name="import" depends="create-mysql-user">
<ant antfile="$
{impex.build.file}" target="empty-schema" inheritall="false" />
<ant antfile="${impex.build.file}
" target="import" inheritall="false" />
<delete file="$
{log.file}
" />
</target>
So, at this point, I"m not really sure what the state of the environment is, or how many properties files have bee read. Let's just assume that generated-build.properties and impex-build.properties are in the mix.
ant then invokes itself, only with the impex build file of the kul-cfg-dbs project and calls empty-schema....
<target name="oracle-empty-schema" depends="inittasks">
<adminsql sql="$
{oracle.empty.schema.commands}
" />
</target>
adminsql executes the following:
"DECLARE temp NUMBER; BEGIN temp := kulcfgusr.kuluser_maint_pk.recreate_user( '<generated-user-name>' ); END;"
Where <generated-user-name> is a string formed from the $DATABASE_APPLICATION_CODE variable in 0.9.4-settings file. Setting this to "rice" and not "rice094" (to make use of the existing RICESTG schema) is not feasible because the same generated user name is used to export data from the RICE094DBA schema (not "RICEDBA").
Added "kupdate stg standard true true Oracle9i" to do-daily-updates.sh
Copied dist-external and dist-war to ant file, sans init target for properties (presumably these are passed in when called by kant).
Changed package name of Oracle9iPlatform in stg-rice-config.xml to point to correct class.