File: tdsodbc.postinst

package info (click to toggle)
freetds 0.82-4
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 10,716 kB
  • ctags: 8,697
  • sloc: ansic: 74,312; sh: 8,868; makefile: 815; perl: 556; php: 22
file content (24 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -e

# Source debconf library.
. /usr/share/debconf/confmodule

db_version 2.0

# Always add in the postinst, always delete in the prerm -- this way,
# we'll always have a good reference count in odbcinst.ini.
db_get freetds/addtoodbc || true
if [ "$RET" = "true" ]; then
	odbcinst -i -d -f /usr/share/tdsodbc/odbcinst.ini 1>&2
fi

if dpkg --compare-versions "$2" lt-nl 0.82-1; then
	# on upgrade from older versions, this file will be left around,
	# preventing removal of the directory; do a one-time cleanup.
	rm -f /var/lib/odbc/freetds.removed
        [ ! -d /var/lib/odbc ] || rmdir --ignore-fail-on-non-empty /var/lib/odbc
fi

#DEBHELPER#