Files
soci/scripts/ci/install_odbc.sh
Vadim Zeitlin a9b2200789 Use debuginfod in Ubuntu CI jobs if it is available
This avoids problems with dbgsym packages that regularly get out of sync
and should also be faster, as the debug symbols will only be retrieved
if necessary instead of being done every time the job runs.

This commit is best viewed ignoring whitespace-only changes.

See #1352.
2026-05-31 20:55:29 +02:00

31 lines
1.1 KiB
Bash
Executable File

#!/usr/bin/env bash
# Install ODBC libraries for SOCI in CI builds
#
# Copyright (c) 2013 Mateusz Loskot <mateusz@loskot.net>
#
source ${SOCI_SOURCE_DIR}/scripts/ci/common.sh
# Remove buggy versions of the packages from Microsoft repositories as well as
# their dependencies.
run_apt remove \
libodbc1 odbcinst1debian2 \
unixodbc unixodbc-dev
packages_to_install="tar bzip2 unixodbc unixodbc-dev odbc-postgresql postgresql"
if [ -z "$DEBUGINFOD_URLS" ]; then
packages_to_install="$packages_to_install unixodbc-dbgsym odbc-postgresql-dbgsym"
fi
run_apt install ${packages_to_install}
# Use full path to the driver library to avoid errors like
# [01000][unixODBC][Driver Manager]Can't open lib 'psqlodbca.so' : file not found
psqlodbca_lib=$(dpkg -L odbc-postgresql | grep -F 'psqlodbca.so')
sudo sed -i'' -e "s@^Driver=psqlodbca\.so@Driver=$psqlodbca_lib@" /etc/odbcinst.ini
echo Contents of /etc/odbcinst.ini
echo '---------------------------------- >8 --------------------------------------'
cat /etc/odbcinst.ini
echo '---------------------------------- >8 --------------------------------------'