Commit 4b6bae3e authored by Andrea Sciaba's avatar Andrea Sciaba
Browse files

In basic test, skip age check if date cannot be parsed

parent b128a1f0
......@@ -232,9 +232,16 @@ if [ $rc == 0 ] ; then
CommitInfoUrl="https://gitlab.cern.ch/api/v4/projects/siteconf%2F${SiteName}/repository/commits/${last_commit}"
./fetch-from-web-gitlab \"$CommitInfoUrl\" $FileInfoTmp
FileDate=$(grep -Po '"authored_date":.*?[^\\]",' ${FileInfoTmp} | perl -pe 's/"authored_date"://; s/^"//; s/",$//')
let seconds=`date +%s`-`date +%s -d "$FileDate"`
let cvsFileAgeInHours=$seconds/3600
echo "GITTFCAge: ${cvsFileAgeInHours} hours"
echo "Commit date: $FileDate"
FileEpoch=`date +%s -d "$FileDate"`
if [ X$FileEpoch == X ] ; then
echo "Error in parsing commit date. Skipping the age check"
cvsFileAgeInHours=0
else
let seconds=`date +%s`-`date +%s -d "$FileDate"`
let cvsFileAgeInHours=$seconds/3600
echo "GITTFCAge: ${cvsFileAgeInHours} hours"
fi
if [ $localTFCfileAgeInHours -gt 120 ] && [ $cvsFileAgeInHours -gt 120 ] ; then
error=1
echo "ERROR: local Trivial Catalog File file differ from GIT"
......
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