diff --git a/dev/build.sh b/dev/build.sh index 79e79e15d..934986401 100755 --- a/dev/build.sh +++ b/dev/build.sh @@ -1,12 +1,16 @@ #!/usr/bin/env bash # Import reusable bits -pushd $( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) > /dev/null +pushd "$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" > /dev/null || exit 1 . functions.sh -popd > /dev/null +popd > /dev/null || exit 1 ALIRE_BUILD_JOBS="${ALIRE_BUILD_JOBS:-0}" -export ALIRE_OS=$(get_OS) +ALIRE_OS=$(get_OS); export ALIRE_OS + +scripts/version-patcher.sh echo "Building with ALIRE_OS=$ALIRE_OS..." -gprbuild "-j$ALIRE_BUILD_JOBS" -r -p -P `dirname $0`/../alr_env.gpr "$@" +gprbuild "-j$ALIRE_BUILD_JOBS" -r -p -P "$(dirname $0)/../alr_env.gpr" "$@" + +scripts/version-patcher.sh _or_later \ No newline at end of file diff --git a/scripts/version-patcher.sh b/scripts/version-patcher.sh index 3de414b66..1b0c07895 100755 --- a/scripts/version-patcher.sh +++ b/scripts/version-patcher.sh @@ -3,6 +3,12 @@ set -o errexit +# Exit already if the ALR_VERSION_DONT_PATCH flag is defined +if [ "${ALR_VERSION_DONT_PATCH:-unset}" != "unset" ]; then + echo "Skipping version patching..." + exit 0 +fi + bin=support/version_patcher/bin/version_patcher # If the binary is already in place, do nothing