Commit a5ed9dd2 authored by ale's avatar ale

Store RC_VERSION in the built tree

Fixes the must-update-db comparison, which would previously fail.
parent a0599010
Pipeline #850 passed with stages
in 3 minutes and 33 seconds
......@@ -9,20 +9,10 @@ all: build
mkdir -p $(TARGET)
./install-roundcube --version=$(RC_VERSION) --destdir=$(TARGET)/src $@
echo $(RC_VERSION) > $(TARGET)/src/.rc_version
-rm -fr $(TARGET)
.PHONY: build clean
#install: build
# install -d -o root -g root -m 755 -p $(DESTDIR)/usr/share/ai-roundcube
# install -m 755 -o root -g root install-roundcube \
# $(DESTDIR)/usr/share/ai-roundcube/install-roundcube
# install -d -o root -g root -m 755 $(DESTDIR)/usr/sbin
# install -m 755 -o root -g root roundcube-maintenance \
# $(DESTDIR)/usr/sbin/roundcube-maintenance
# mkdir -p $(TARGET)/roundcubemail-standby
# (for f in standby/.htaccess standby/standby.html ; do \
# install -m 644 -o root -g root $$f $(TARGET)/roundcubemail-standby/ ; done)
......@@ -47,7 +47,8 @@ done
# Now set up the MySQL database for Roundcube. The current Roundcube
# version is stored in the database.
cur_version=$(mysql -NBe 'select version from rc_version' ${MYSQL_DB} 2>/dev/null)
rc_version=$(cat ${TARGET_DIR}/.rc_version)
cur_version=$(${MYSQL} -NBe 'select version from rc_version' ${MYSQL_DB} 2>/dev/null)
# If cur_version is empty, it means that the database has not been
# initialized yet.
......@@ -59,9 +60,11 @@ if [ -z "${cur_version}" ]; then
# Run database upgrade if necessary.
${TARGET_DIR}/bin/ -v ${cur_version} -y \
|| die "Roundcube update script failed"
if [ "${rc_version}" != "${cur_version}" ]; then
${TARGET_DIR}/bin/ -v ${cur_version} -y \
|| die "Roundcube update script failed"
${MYSQL} -e "update rc_version set version='${RC_VERSION}'" ${MYSQL_DB}
${MYSQL} -e "update rc_version set version='${rc_version}'" ${MYSQL_DB}
exit 0
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment