Invert logic for repo detection in all.sh

Instead of:
    ! in_psa_crypto_repo()
use
    in_mbedtls_repo()

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2023-08-17 17:32:26 +01:00
parent e31014a681
commit 76a7738537

View file

@ -123,8 +123,8 @@ set -e -o pipefail -u
# Enable ksh/bash extended file matching patterns # Enable ksh/bash extended file matching patterns
shopt -s extglob shopt -s extglob
in_psa_crypto_repo () { in_mbedtls_repo () {
test -d core test ! -d core
} }
pre_check_environment () { pre_check_environment () {
@ -135,10 +135,10 @@ pre_check_environment () {
} }
pre_initialize_variables () { pre_initialize_variables () {
if in_psa_crypto_repo; then if in_mbedtls_repo; then
CONFIG_H='drivers/builtin/include/mbedtls/mbedtls_config.h'
else
CONFIG_H='include/mbedtls/mbedtls_config.h' CONFIG_H='include/mbedtls/mbedtls_config.h'
else
CONFIG_H='drivers/builtin/include/mbedtls/mbedtls_config.h'
fi fi
CRYPTO_CONFIG_H='include/psa/crypto_config.h' CRYPTO_CONFIG_H='include/psa/crypto_config.h'
CONFIG_TEST_DRIVER_H='tests/include/test/drivers/config_test_driver.h' CONFIG_TEST_DRIVER_H='tests/include/test/drivers/config_test_driver.h'
@ -149,7 +149,7 @@ pre_initialize_variables () {
backup_suffix='.all.bak' backup_suffix='.all.bak'
# Files clobbered by config.py # Files clobbered by config.py
files_to_back_up="$CONFIG_H $CRYPTO_CONFIG_H $CONFIG_TEST_DRIVER_H" files_to_back_up="$CONFIG_H $CRYPTO_CONFIG_H $CONFIG_TEST_DRIVER_H"
if ! in_psa_crypto_repo; then if in_mbedtls_repo; then
# Files clobbered by in-tree cmake # Files clobbered by in-tree cmake
files_to_back_up="$files_to_back_up Makefile library/Makefile programs/Makefile tests/Makefile programs/fuzz/Makefile" files_to_back_up="$files_to_back_up Makefile library/Makefile programs/Makefile tests/Makefile programs/fuzz/Makefile"
fi fi
@ -309,7 +309,7 @@ EOF
# Does not remove generated source files. # Does not remove generated source files.
cleanup() cleanup()
{ {
if ! in_psa_crypto_repo; then if in_mbedtls_repo; then
command make clean command make clean
fi fi
@ -5276,7 +5276,7 @@ pre_prepare_outcome_file
pre_print_configuration pre_print_configuration
pre_check_tools pre_check_tools
cleanup cleanup
if ! in_psa_crypto_repo; then if in_mbedtls_repo; then
pre_generate_files pre_generate_files
fi fi