lidavidm commented on code in PR #48578:
URL: https://github.com/apache/arrow/pull/48578#discussion_r2660305885


##########
cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc_ini.sh:
##########
@@ -0,0 +1,82 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# GH-47876 TODO: create macOS ODBC Installer.
+# Script for installing macOS ODBC driver, to be used for macOS installer.
+
+source_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
+
+odbc_install_script="${source_dir}/install_odbc.sh"
+
+chmod +x "$odbc_install_script"
+. "$odbc_install_script" 
/Library/Apache/ArrowFlightSQLODBC/lib/libarrow_flight_sql_odbc.dylib

Review Comment:
   Do we have to source the script?



##########
cpp/src/arrow/flight/sql/odbc/install/mac/install_odbc.sh:
##########
@@ -0,0 +1,76 @@
+#!/bin/sh
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+# Used by macOS ODBC installer script and macOS ODBC testing
+
+ODBC_64BIT="$1"
+
+if [[ -z "$ODBC_64BIT" ]]; then
+  echo "error: 64-bit driver is not specified. Call format: install_odbc 
abs_path_to_64_bit_driver"
+  exit 1
+fi
+
+if [ ! -f $ODBC_64BIT ]; then
+    echo "64-bit driver can not be found: $ODBC_64BIT"
+         echo "Call format: install_odbc abs_path_to_64_bit_driver"
+    exit 1
+fi
+
+USER_ODBCINST_FILE="$HOME/Library/ODBC/odbcinst.ini"
+DRIVER_NAME="Apache Arrow Flight SQL ODBC Driver"
+DSN_NAME="Apache Arrow Flight SQL ODBC DSN"
+
+mkdir -p $HOME/Library/ODBC
+
+touch "$USER_ODBCINST_FILE"
+
+# Admin privilege is needed to add ODBC driver registration
+if [ $EUID -ne 0 ]; then 
+    echo "Please run this script with sudo"
+    exit 1
+fi

Review Comment:
   Should we do this check up front?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to