From ae0abc847acabdbe2e72a8dcc05799127951cb3d Mon Sep 17 00:00:00 2001 From: Michele Locati Date: Fri, 8 Sep 2023 10:31:34 +0200 Subject: [PATCH] MS ODBC Sql on Alpine: support arm64, install 18.3.1.1-1 instead of 18.0.1.1-1 (#799) --- install-php-extensions | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/install-php-extensions b/install-php-extensions index 3c1d979..b79cd62 100755 --- a/install-php-extensions +++ b/install-php-extensions @@ -1974,16 +1974,24 @@ isMicrosoftSqlServerODBCInstalled() { } # Install the Microsoft SQL Server ODBC Driver +# see https://learn.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server installMicrosoftSqlServerODBC() { printf 'Installing the Microsoft SQL Server ODBC Driver\n' case "$DISTRO" in alpine) - # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#alpine17 rm -rf /tmp/src/msodbcsql.apk if test $PHP_MAJMIN_VERSION -le 703; then curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/e/4/e/e4e67866-dffd-428c-aac7-8d28ddafb39b/msodbcsql17_17.9.1.1-1_amd64.apk else - curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/b/9/f/b9f3cce4-3925-46d4-9f46-da08869c6486/msodbcsql18_18.0.1.1-1_amd64.apk + case $(uname -m) in + aarch64 | arm64 | armv8) + installMicrosoftSqlServerODBC_arch=arm64 + ;; + *) + installMicrosoftSqlServerODBC_arch=amd64 + ;; + esac + curl -sSLf -o /tmp/src/msodbcsql.apk https://download.microsoft.com/download/3/5/5/355d7943-a338-41a7-858d-53b259ea33f5/msodbcsql18_18.3.1.1-1_$installMicrosoftSqlServerODBC_arch.apk fi printf '\n' | apk add --allow-untrusted /tmp/src/msodbcsql.apk rm -rf /tmp/src/msodbcsql.apk @@ -1992,8 +2000,6 @@ installMicrosoftSqlServerODBC() { if test $DISTRO_VERSION_NUMBER -eq 12; then DISTRO_VERSION_NUMBER=11 fi - - # https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server#debian17 printf -- '- installing the Microsoft APT key\n' if test $DISTRO_VERSION_NUMBER -eq 11; then curl -sSLf -o /etc/apt/trusted.gpg.d/microsoft.asc https://packages.microsoft.com/keys/microsoft.asc @@ -2017,7 +2023,6 @@ installMicrosoftSqlServerODBC() { else DEBIAN_FRONTEND=noninteractive ACCEPT_EULA=Y apt-get install -qqy --no-install-recommends $IPE_APTGET_INSTALLOPTIONS '^msodbcsql[0-9]+$' fi - if test $DISTRO_VERSION_NUMBER -eq 11; then setDistro fi