change output file of updated translation status script
the build was successful Details

This commit is contained in:
Max Mehl 2018-04-04 08:05:16 +02:00
parent c2de897e86
commit 840fb4ae4b
Signed by: max.mehl
GPG Key ID: 2704E4AB371E2E92
1 changed files with 11 additions and 10 deletions

View File

@ -1,10 +1,11 @@
#! /bin/bash
OUT=/var/www/web/translations.html
cd /srv/www/fsfe.org_git
nowlang=''
yearago=`date +%s --date='1 year ago'`
cat > translations.html << _END_
cat > ${OUT} << _END_
<html>
<body>
<p><span style="color: red">Red entries</span> are pages where the original is newer than one year, and the translation is more than 3 months old. <span style="color: orange">Orange entries</span> are pages where the translation is older, but the original is older than one year.</p>
@ -19,7 +20,7 @@ find . -type f -iname "*\.en\.xhtml" | grep -v '^./[a-z][a-z]/\|^./news'|sed 's/
echo $lang_uniq
done
done|sort|uniq|while read lang_uniq; do
echo "<a href=#$lang_uniq>$lang_uniq</a>" >> translations.html
echo "<a href=#$lang_uniq>$lang_uniq</a>" >> ${OUT}
done
find . -type f -iname "*\.en\.xhtml" | grep -v '^./[a-z][a-z]/\|^./news'|sed 's/\.[a-z][a-z]\.xhtml//'|sort|while read A; do
@ -38,11 +39,11 @@ done|sort -t' ' -k 1,1 -k 3nr,3 -k 5nr,5|\
while read lang page originaldate trdate diff; do
if [[ $nowlang != $lang ]]; then
if [[ $nowlang != "" ]]; then
echo "</table>" >> translations.html
echo "</table>" >> ${OUT}
fi
echo "<h1 id=\"$lang\">Language: $lang</h1>" >> translations.html
echo "<table>" >> translations.html
echo "<tr><th>Page</th><th>Original date</th><th>Translation date</th><th>Age (in days)</th></tr>" >> translations.html
echo "<h1 id=\"$lang\">Language: $lang</h1>" >> ${OUT}
echo "<table>" >> ${OUT}
echo "<tr><th>Page</th><th>Original date</th><th>Translation date</th><th>Age (in days)</th></tr>" >> ${OUT}
nowlang=$lang
fi
orig=`date +"%Y-%m-%d" --date="@$originaldate"`
@ -56,10 +57,10 @@ while read lang page originaldate trdate diff; do
else
color=''
fi
echo "<tr><td$color>$page</td><td>$orig</td><td>$tr</td><td$color>$diffdays</td></tr>" >> translations.html
echo "<tr><td$color>$page</td><td>$orig</td><td>$tr</td><td$color>$diffdays</td></tr>" >> ${OUT}
done
echo "</table>" >> translations.html
echo "</body>" >> translations.html
echo "</html>" >> translations.html
echo "</table>" >> ${OUT}
echo "</body>" >> ${OUT}
echo "</html>" >> ${OUT}