<commit_before>#!/bin/sh
set -e

MAIL_FROM=${MAIL_FROM:-<EMAIL>}
MAIL_TO=${MAIL_TO:-<EMAIL>}
SENDMAIL=${SENDMAIL:-sendmail}

cd "`dirname \"$0\"`"/../..
branch_name=`svn info | sed -n '/^URL:/s@.*/svn/\(.*\)@\1@p'`
wc_version=`svnversion subversion/po | sed -e 's/[MS]//g'`

output_log="po-status-stdout-log"
error_log="po-status-stderr-log"

rm "$output_log" "$error_log"

# prevent conflicts
svn revert --recursive subversion/po 2>>$error_log >>$output_log || \
{
    ###TODO: mail your output!
    exit 1
}

# update && initialize
svn update 2>>$error_log >>$output_log && \
tools/po/po-update.sh 2>>$error_log >>$output_log || \
{
    # mail your output
    echo "Unable to successfully complete; check error log."
    exit 1
}

$SENDMAIL -t <<EOF
From: $MAIL_FROM
To: $MAIL_TO
Subject: [l10n] Translation status for $branch_name r$wc_version

`tools/po/svn-po-status-report.sh`
EOF<commit_msg>* tools/po/svn-po-status-run.sh:     "rm" -> "rm -f" to avoid dying if files being cleaned do not exist.<commit_after>#!/bin/sh
set -e

MAIL_FROM=${MAIL_FROM:-<EMAIL>}
MAIL_TO=${MAIL_TO:-<EMAIL>}
SENDMAIL=${SENDMAIL:-sendmail}

cd "`dirname \"$0\"`"/../..
branch_name=`svn info | sed -n '/^URL:/s@.*/svn/\(.*\)@\1@p'`
wc_version=`svnversion subversion/po | sed -e 's/[MS]//g'`

output_log="po-status-stdout-log"
error_log="po-status-stderr-log"

rm -f "$output_log" "$error_log"

# prevent conflicts
svn revert --recursive subversion/po 2>>$error_log >>$output_log || \
{
    ###TODO: mail your output!
    exit 1
}

# update && initialize
svn update 2>>$error_log >>$output_log && \
tools/po/po-update.sh 2>>$error_log >>$output_log || \
{
    # mail your output
    echo "Unable to successfully complete; check error log."
    exit 1
}

$SENDMAIL -t <<EOF
From: $MAIL_FROM
To: $MAIL_TO
Subject: [l10n] Translation status for $branch_name r$wc_version

`tools/po/svn-po-status-report.sh`
EOF
{'fraction_non_alphanumeric': 0.1931216931216931, 'fraction_numerical': 0.009523809523809525, 'mean_word_length': 4.042666666666666, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 32, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2109716', 'n_tokens_mistral': 778, 'n_tokens_neox': 761, 'n_words': 166}