Fix wrong array reference.
[davical.git] / scripts / build-always.sh
blob085485ddebc191b5691548aa8642eafc75f35572
1 #!/bin/sh
3 # Apply the current version numbers into always.php from always.php.in
6 DAVICAL_VERSION="`head -n1 VERSION`"
7 DB_VERSION="`grep 'SELECT new_db_revision' dba/davical.sql | cut -f2 -d'(' | cut -f1-3 -d,`"
8 AWL_VERSION="`head -n1 ../awl/VERSION`"
9 if [ -z "${AWL_VERSION}" ] ; then
10 AWL_VERSION="'`grep 'want_awl_version' inc/always.php.in | cut -f2 -d= | cut -f1 -d';' | sed 's: ::g'`'"
13 sed -e "/^ *.c->version_string *= *'[^']*' *;/ s/^ *.c->version_string *= *'[^']*' *;/\$c->version_string = '${DAVICAL_VERSION}';/" \
14 -e "/^ *.c->want_dbversion *=.*$/ s/^ *.c->want_dbversion *=.*$/\$c->want_dbversion = array(${DB_VERSION});/" \
15 -e "/^ *.c->want_awl_version *=.*$/ s/^ *.c->want_awl_version *=.*$/\$c->want_awl_version = '${AWL_VERSION}';/"