Improve translation error checking

If translate_ciphers.py is used incorrectly in compat.sh, an error
check function - check_translation - is called to evaluate and inform
the user of the error that has occured.

Added an output that informs the users an error has taken place in
translate_ciphers.py incase the error response is an empty string.

Signed-off-by: Joe Subbiani <joe.subbiani@arm.com>
This commit is contained in:
Joe Subbiani 2021-07-29 12:51:09 +01:00
parent c3610baddf
commit 439a696903

View file

@ -238,8 +238,9 @@ reset_ciphersuites()
check_translation()
{
if [ $? -eq 1 ]; then
echo $T
if [ $1 -ne 0 ]; then
echo "translate_ciphers.py failed with exit code $1" >&2
echo "$2" >&2
exit 1
fi
}
@ -329,11 +330,11 @@ add_common_ciphersuites()
M_CIPHERS="$M_CIPHERS $CIPHERS"
T=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
check_translation $? $T
check_translation $? "$T"
G_CIPHERS="$G_CIPHERS $T"
T=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
check_translation $? $T
check_translation $? "$T"
O_CIPHERS="$O_CIPHERS $T"
}
@ -417,7 +418,7 @@ add_openssl_ciphersuites()
M_CIPHERS="$M_CIPHERS $CIPHERS"
T=`python3 scripts/translate_ciphers.py o "$CIPHERS"`
check_translation $? $T
check_translation $? "$T"
O_CIPHERS="$O_CIPHERS $T"
}
@ -551,7 +552,7 @@ add_gnutls_ciphersuites()
M_CIPHERS="$M_CIPHERS $CIPHERS"
T=`python3 scripts/translate_ciphers.py g "$CIPHERS"`
check_translation $? $T
check_translation $? "$T"
G_CIPHERS="$G_CIPHERS $T"
}