From 5632c764962a0533a47efaa682168bb07c9802f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hern=C3=A1n=20Casta=C3=B1=C3=B3n=20=C3=81lvarez?= Date: Tue, 18 Jul 2023 23:28:58 +0200 Subject: [PATCH] vendor: build: allow to set x.z versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I66ddebbdc85eb75d363a1ddebfee00ce534c9954 Signed-off-by: Hernán Castañón Álvarez --- build.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build.sh b/build.sh index 1590f557..c6e1c475 100755 --- a/build.sh +++ b/build.sh @@ -119,11 +119,11 @@ fi # Setup AOSPA version if specified if [ $AOSPA_USER_VERSION ]; then - # Check is it a number - if [ ! -z "${AOSPA_USER_VERSION##*[!0-9]*}" ]; then - export AOSPA_BUILDVERSION=${AOSPA_USER_VERSION} + # Check if it is a number + if [[ $AOSPA_USER_VERSION =~ ^[0-9]+(\.[0-9]+)?$ ]]; then + export AOSPA_BUILDVERSION=$AOSPA_USER_VERSION else - echo -e "${CLR_BLD_RED} Invalid AOSPA minor version - use any non-negative integer${CLR_RST}" + echo -e "${CLR_BLD_RED}Invalid AOSPA version - use any non-negative number${CLR_RST}" exit 1 fi fi