2014-02-22 17:29:27 +00:00
|
|
|
#!/bin/sh
|
2014-02-13 22:13:21 +00:00
|
|
|
cd $(dirname $0)
|
2013-12-08 20:16:46 +00:00
|
|
|
. ./etc/update.vars
|
2014-02-14 01:51:52 +00:00
|
|
|
[ -f ./etc/update.vars.custom ] && . ./etc/update.vars.custom
|
2013-12-08 20:16:46 +00:00
|
|
|
|
2014-02-23 18:20:58 +00:00
|
|
|
[ ! -f $TOUCHFILE ] && touch $TOUCHFILE
|
|
|
|
|
2013-08-31 23:52:07 +00:00
|
|
|
TMP=$(mktemp XXXXXXXXXX)
|
|
|
|
trap 'rm -f $TMP;exit' 0 1 2 15
|
2013-08-14 22:18:06 +00:00
|
|
|
|
2020-09-10 00:05:01 +00:00
|
|
|
if [ -d ./.git ]; then
|
|
|
|
git pull origin master 2>&1 | tee $TMP
|
2020-09-12 03:52:22 +00:00
|
|
|
|
2020-09-10 00:05:01 +00:00
|
|
|
if grep "i2p2www/translations/" "$TMP" >/dev/null ; then
|
|
|
|
echo "Translations updated, compiling messages"
|
|
|
|
./compile-messages.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Git revision: $(git log -n 1 | grep commit | sed 's/commit: //' | sed 's/ .*$//')" >./i2p2www/pages/include/mtnversion
|
|
|
|
|
|
|
|
if grep "^git: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" "$TMP" >/dev/null ; then
|
|
|
|
echo "Python files changed, restarting server"
|
|
|
|
touch $TOUCHFILE
|
|
|
|
fi
|
2020-09-12 03:52:22 +00:00
|
|
|
|
2020-09-10 00:05:01 +00:00
|
|
|
else
|
2020-09-12 03:52:22 +00:00
|
|
|
|
2020-09-10 00:05:01 +00:00
|
|
|
$MTN pull -k "" "mtn://$MTNURL?$MTNBRANCH"
|
|
|
|
$MTN up 2>&1 | tee $TMP
|
|
|
|
if grep "^mtn: \(add\|patch\|dropp\|updat\)\(ed\|ing\) 'i2p2www/translations/" "$TMP" >/dev/null ; then
|
|
|
|
echo "Translations updated, compiling messages"
|
|
|
|
./compile-messages.sh
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Monotone revision: $(mtn log --no-files --no-graph --to h: | grep Revision | sed 's/Revision: //')" >./i2p2www/pages/include/mtnversion
|
|
|
|
|
|
|
|
if grep "^mtn: updating 'i2p2www/.*\.py\|^mtn: updating 'i2p2www/.*/.*\.py" "$TMP" >/dev/null ; then
|
|
|
|
echo "Python files changed, restarting server"
|
|
|
|
touch $TOUCHFILE
|
|
|
|
fi
|
2013-08-14 22:18:06 +00:00
|
|
|
fi
|
2014-02-23 23:36:48 +00:00
|
|
|
[ -f ./.pybabel-stamp ] || ./compile-messages.sh
|