mirror of
https://github.com/Mbed-TLS/mbedtls-framework.git
synced 2026-09-11 20:59:54 +00:00
Add branch detection
Signed-off-by: Elena Uziunaite <[email protected]>
This commit is contained in:
@@ -27,3 +27,36 @@ in_tf_psa_crypto_repo () {
|
||||
read_project_name_file
|
||||
test "$PROJECT_NAME" = "TF-PSA-Crypto"
|
||||
}
|
||||
|
||||
#Branch detection
|
||||
read_build_info () {
|
||||
BUILD_INFO_FILE='../../include/mbedtls/build_info.h'
|
||||
|
||||
if [ ! -f "$BUILD_INFO_FILE" ]; then
|
||||
echo "File $BUILD_INFO_FILE not found."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MBEDTLS_VERSION_MAJOR=$(grep "^#define MBEDTLS_VERSION_MAJOR" "$BUILD_INFO_FILE" | awk '{print $3}')
|
||||
MBEDTLS_VERSION_MINOR=$(grep "^#define MBEDTLS_VERSION_MINOR" "$BUILD_INFO_FILE" | awk '{print $3}')
|
||||
|
||||
if [ -z "$MBEDTLS_VERSION_MAJOR" ]; then
|
||||
echo "MBEDTLS_VERSION_MAJOR not found in $BUILD_INFO_FILE."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$MBEDTLS_VERSION_MINOR" ]; then
|
||||
echo "MBEDTLS_VERSION_MINOR not found in $BUILD_INFO_FILE."
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
in_3_6_branch () {
|
||||
read_build_info
|
||||
test $MBEDTLS_VERSION_MAJOR = "3" && test $MBEDTLS_VERSION_MINOR = "6"
|
||||
}
|
||||
|
||||
in_4_x_branch () {
|
||||
read_build_info
|
||||
test $MBEDTLS_VERSION_MAJOR = "4"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user