[GRASS-SVN] r66177 - grass-addons/tools/addons
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Sep 12 05:21:02 PDT 2015
Author: martinl
Date: 2015-09-12 05:21:02 -0700 (Sat, 12 Sep 2015)
New Revision: 66177
Modified:
grass-addons/tools/addons/grass-addons.sh
Log:
addons cronjob scripts: better check when to compile (script runs every 15min)
Modified: grass-addons/tools/addons/grass-addons.sh
===================================================================
--- grass-addons/tools/addons/grass-addons.sh 2015-09-12 11:46:35 UTC (rev 66176)
+++ grass-addons/tools/addons/grass-addons.sh 2015-09-12 12:21:02 UTC (rev 66177)
@@ -7,6 +7,7 @@
MANDIR=/var/www/grass/grass-cms/
XMLDIR=/var/www/grass/addons/
#??? MANDIR=/var/www/grass
+CHECK_EVERY_MIN=15
if [ ! -d "$XMLDIR" ]; then
mkdir -p $XMLDIR
@@ -76,8 +77,16 @@
cd $DIR/grass-addons/
-nup=`(svn up || (svn cleanup && svn up)) | wc -l`
-if [ "$nup" -gt 1 ] || [ "$1" = "f" ] ; then
+# update
+svn up || (svn cleanup && svn up)
+
+# check last change
+date_last=`svn info --incremental --xml | grep date | cut -d '>' -f2 | cut -d '<' -f1`
+num_last=`date --date="$date_last" +%s`
+num_now=`date -u +%s`
+count=$(echo "($num_now - $num_last) / 60." | bc)
+
+if [ "$count" -lt "$CHECK_EVERY_MIN" ] || [ "$1" = "f" ] ; then
build_addons $1
exit 0
fi
More information about the grass-commit
mailing list