Debian Codegraph @

debian/postgresql-doc-18.postinst

raw
1 #!/bin/sh
2
3 set -e
4
5 VERSION=${DPKG_MAINTSCRIPT_PACKAGE##*-}
6
7 # arguments: version master package [package]
8 __link_manpages() {
9 MANS=$(unset GREP_OPTIONS; dpkg -L $3 $4 $5 2>/dev/null | grep -E '/man/.*\.[1-9](\.gz)?$' | grep -v "$2") || true
10 [ -n "$MANS" ] || return 0
11
12 SLAVES=$(for i in $MANS; do TARGET=$(echo $i | sed "s/postgresql\/$1\///"); echo -n " --slave $TARGET $(basename $i) $i"; done)
13
14 mkdir -p /usr/share/man/man3
15 section=$(echo "$2" | sed -e 's/.*\.\(.*\)\..*/man\1/')
16 update-alternatives --install /usr/share/man/$section/$2 \
17 $2 /usr/share/postgresql/$1/man/$section/$2 \
18 ${1}0 $SLAVES
19 }
20
21 if [ "$1" = configure ]; then
22 if [ -f /usr/share/postgresql-common/maintscripts-functions ]; then
23 . /usr/share/postgresql-common/maintscripts-functions
24 configure_doc_version $VERSION "$2"
25 else
26 __link_manpages $VERSION SPI_connect.3.gz "postgresql-doc-$VERSION"
27 fi
28 fi
29
30 #DEBHELPER#