File: postgresql-doc-13.postinst

package info (click to toggle)
postgresql-13 13.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 150,404 kB
  • sloc: ansic: 869,969; sql: 91,820; yacc: 33,831; xml: 31,046; perl: 28,373; lex: 8,698; makefile: 6,037; sh: 4,879; cpp: 668; python: 158; asm: 65; sed: 15
file content (29 lines) | stat: -rw-r--r-- 944 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
25
26
27
28
29
#!/bin/sh

set -e

VERSION=${DPKG_MAINTSCRIPT_PACKAGE##*-}

# arguments: version master package [package]
__link_manpages() {
    MANS=$(unset GREP_OPTIONS; dpkg -L $3 $4 $5 2>/dev/null|egrep '/man/.*\.[1-9](\.gz)?$' | grep -v "$2") || true
    [ -n "$MANS" ] || return 0

    SLAVES=$(for i in $MANS; do TARGET=$(echo $i | sed "s/postgresql\/$1\///"); echo -n " --slave $TARGET $(basename $i) $i"; done)

    section=$(echo "$2" | sed -e 's/.*\.\(.*\)\..*/man\1/')
    update-alternatives --install /usr/share/man/$section/$2 \
        $2 /usr/share/postgresql/$1/man/$section/$2 \
        $(echo "$1" | tr -cd 0-9) $SLAVES
}

if [ "$1" = configure ]; then
    if [ -f /usr/share/postgresql-common/maintscripts-functions ]; then
        . /usr/share/postgresql-common/maintscripts-functions
        configure_doc_version $VERSION "$2"
    else
        __link_manpages $VERSION SPI_connect.3.gz "postgresql-doc-$VERSION"
    fi
fi

#DEBHELPER#