From 6cd0fbdc492c60adf79ce4518e6b854f7facffb1 Mon Sep 17 00:00:00 2001 From: Daniele Varrazzo Date: Sun, 5 Jan 2025 21:51:57 +0100 Subject: [PATCH] fix(macos): don't crash on undefined variable --- scripts/build/build_libpq.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/build/build_libpq.sh b/scripts/build/build_libpq.sh index 0baf37be..107460f8 100755 --- a/scripts/build/build_libpq.sh +++ b/scripts/build/build_libpq.sh @@ -62,7 +62,7 @@ case "$ID" in # openssl no matter what so remove it. Since homebrew's curl depends on # it, force use of system curl. brew uninstall --force --ignore-dependencies openssl gettext curl - if [ -z "$MACOSX_ARCHITECTURE" ]; then + if [ -z "${MACOSX_ARCHITECTURE:-}" ]; then MACOSX_ARCHITECTURE="$(uname -m)" fi # Set the deployment target to be <= to that of the oldest supported Python version. @@ -110,7 +110,7 @@ if [ "$ID" == "centos" ] || [ "$ID" == "macos" ]; then options=(--prefix=${LIBPQ_BUILD_PREFIX} --openssldir=${LIBPQ_BUILD_PREFIX} \ zlib -fPIC shared) - if [ -z "$MACOSX_ARCHITECTURE" ]; then + if [ -z "${MACOSX_ARCHITECTURE:-}" ]; then ./config $options else ./configure "darwin64-$MACOSX_ARCHITECTURE-cc" $options