From daeda765a16a86b12c0d99f67b7b7adfc231e88f Mon Sep 17 00:00:00 2001 From: Andrea Dell'Amico Date: Fri, 15 Sep 2017 19:25:06 +0200 Subject: [PATCH] Other fixes to library/roles/smartgears/dataminer_app/templates/algorithms-updater.j2. --- smartgears/dataminer_app/templates/algorithms-updater.j2 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/smartgears/dataminer_app/templates/algorithms-updater.j2 b/smartgears/dataminer_app/templates/algorithms-updater.j2 index 450c1b6b..19d2e910 100644 --- a/smartgears/dataminer_app/templates/algorithms-updater.j2 +++ b/smartgears/dataminer_app/templates/algorithms-updater.j2 @@ -112,14 +112,13 @@ function algorithms_updater() { echo "else" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " echo 'egrep -v ^$ALGO_NAME\ $ALGORITHMS_INSTALLED_FILE > ${ALGORITHMS_INSTALLED_FILE}_ " >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " echo 'mv ${ALGORITHMS_INSTALLED_FILE}_ $ALGORITHMS_INSTALLED_FILE" >> $ALGORITHMS_TEMP_SCRIPT.body_ - echo " echo '$ALGO_NAME | $ALGO_TIMESTAMP' >> $ALGORITHMS_INSTALLED_FILE" >> $ALGORITHMS_TEMP_SCRIPT.body_ + echo " echo '$ALGO_NAME | $ALGO_DATE' >> $ALGORITHMS_INSTALLED_FILE" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " logger 'algorithms-updater: the adding of algorithm $ALGO_NAME succeeded'" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "fi" >> $ALGORITHMS_TEMP_SCRIPT.body_ else ALGO_LOCAL_TIMESTAMP=0 - # ALGO_LOCAL_DATE=$( egrep ^"$ALGO_NAME" $ALGORITHMS_INSTALLED_FILE | awk -F \| '{ print $2 }' | grep -v \' ) - # ALGO_LOCAL_TIMESTAMP=$( date +%s -d "$ALGO_LOCAL_DATE" 2>/dev/null ) - ALGO_LOCAL_TIMESTAMP=$( egrep ^"$ALGO_NAME" $ALGORITHMS_INSTALLED_FILE | tail -1 | awk -F \| '{ print $2 }' | grep -v \' ) + ALGO_LOCAL_DATE=$( egrep ^$ALGO_NAME\ $ALGORITHMS_INSTALLED_FILE | tail -1 | awk -F \| '{ print $2 }' | grep -v \' ) + ALGO_LOCAL_TIMESTAMP=$( date +%s -d "$ALGO_LOCAL_DATE" 2>/dev/null ) if [ $? -ne 0 ] || [ $ALGO_LOCAL_TIMESTAMP -ne $ALGO_TIMESTAMP ]; then echo "logger 'algorithms-updater: running the add command of algorithm $ALGO_NAME'" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "logger 'algorithms-updater: the add command string is $ALGO_BODY'" >> $ALGORITHMS_TEMP_SCRIPT.body_ @@ -139,7 +138,7 @@ function algorithms_updater() { echo "else" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " echo 'egrep -v ^$ALGO_NAME\ $ALGORITHMS_INSTALLED_FILE > ${ALGORITHMS_INSTALLED_FILE}_ " >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " echo 'mv ${ALGORITHMS_INSTALLED_FILE}_ $ALGORITHMS_INSTALLED_FILE" >> $ALGORITHMS_TEMP_SCRIPT.body_ - echo " echo '$ALGO_NAME | $ALGO_TIMESTAMP' >> $ALGORITHMS_INSTALLED_FILE" >> $ALGORITHMS_TEMP_SCRIPT.body_ + echo " echo '$ALGO_NAME | $ALGO_DATE' >> $ALGORITHMS_INSTALLED_FILE" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo " logger 'algorithms-updater: the adding of algorithm $ALGO_NAME succeeded'" >> $ALGORITHMS_TEMP_SCRIPT.body_ echo "fi" >> $ALGORITHMS_TEMP_SCRIPT.body_ fi