Merge pull request #9763 from eleuzi01/issue-39-fw

Add project and branch detection in shell
This commit is contained in:
David Horstmann 2024-11-27 16:51:19 +00:00 committed by GitHub
commit 8cf83c04aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 11 additions and 21 deletions

@ -1 +1 @@
Subproject commit f1119c2e80d0a3ce1260fbf3714f5955b4abd026 Subproject commit c3cee628f52aab5b9b2a617f2e594683122014f3

View File

@ -28,18 +28,11 @@ EOF
# Copyright The Mbed TLS Contributors # Copyright The Mbed TLS Contributors
# SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later # SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
# This script must be invoked from the project's root.
set -eu set -eu
# Project detection . framework/scripts/project_detection.sh
PROJECT_NAME_FILE='./scripts/project_name.txt'
if read -r PROJECT_NAME < "$PROJECT_NAME_FILE"; then :; else
echo "$PROJECT_NAME_FILE does not exist... Exiting..." >&2
exit 1
fi
in_mbedtls_repo () {
test "$PROJECT_NAME" = "Mbed TLS"
}
# Collect stats and build a HTML report. # Collect stats and build a HTML report.
lcov_library_report () { lcov_library_report () {

View File

@ -22,13 +22,7 @@ EOF
exit exit
fi fi
in_mbedtls_repo () { . framework/scripts/project_detection.sh
test -d include -a -d library -a -d programs -a -d tests
}
in_tf_psa_crypto_repo () {
test -d include -a -d core -a -d drivers -a -d programs -a -d tests
}
if in_mbedtls_repo; then if in_mbedtls_repo; then
if [ -d tf-psa-crypto ]; then if [ -d tf-psa-crypto ]; then

View File

@ -10,6 +10,7 @@
# This script must be invoked from the project's root. # This script must be invoked from the project's root.
source framework/scripts/all-core.sh FRAMEWORK="$PWD/framework"
source $FRAMEWORK/scripts/all-core.sh
main "$@" main "$@"

View File

@ -19,10 +19,12 @@ fi
if [ -d ../include/mbedtls -a -d ../framework ]; then if [ -d ../include/mbedtls -a -d ../framework ]; then
# Running inside an mbedtls checkout: get the framework from mbedtls. # Running inside an mbedtls checkout: get the framework from mbedtls.
source ../framework/scripts/all-core.sh FRAMEWORK="$PWD/../framework"
else else
# Running standalone: use our own framework. # Running standalone: use our own framework.
source framework/scripts/all-core.sh FRAMEWORK="$PWD/framework"
fi fi
source $FRAMEWORK/scripts/all-core.sh
main "$@" main "$@"