This file is indexed.

preinst is in pdns-server 4.1.1-1.

This file is a maintainer script. It is executed when installing (*inst) or removing (*rm) the package.

The actual contents of the file can be viewed below.

 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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/sh
set -e

ucf_delete_unchanged() {
  # pdns-server no longer Depends: ucf, so only do this if ucf is installed.
  if which ucf >/dev/null; then
    if ucfq --with-colons "$1" | grep -q ':pdns-server:Yes:No'; then
      # file exists, not changed; delete it
      echo "Removing unchanged configuration file $1"
      rm -f "$1"
    fi
    ucf --purge "$1"
    ucfr --purge pdns-server "$1"
  else
    echo "E: ucf not installed, can not remove unchanged configuration file $1."
  fi
}

backup_conffile() {
  if [ -e "$1" ]; then
    echo "Moving configuration file $1 to $1.dpkg-bak"
    mv -f "$1" "$1".dpkg-bak
  fi
}

case "$1" in
  install|upgrade)
    # for upgrades from before 4.0.0-2, drop empty file created by previous postinst.
    if [ -e /etc/powerdns/bindbackend.conf ] && echo "d41d8cd98f00b204e9800998ecf8427e /etc/powerdns/bindbackend.conf" | md5sum --check --status; then
      rm -f /etc/powerdns/bindbackend.conf
    fi

    # 4.0.0-2 moved pdns-server' configuration files back under dpkg conffile control (from ucf),
    # and bindbackend was split into its own package.
    # the upgrade code in 4.0.0-2 did not delete unchanged files.
    if [ ! -z "$2" ] && dpkg --compare-versions "$2" le "4.0.0-3~"; then
      # we want to preserve the following if they were changed.
      ucf_delete_unchanged "/etc/default/pdns"
      ucf_delete_unchanged "/etc/powerdns/pdns.conf"
      ucf_delete_unchanged "/etc/powerdns/pdns.d/pdns.local.conf"
      # pdns.simplebind.conf is no longer useful with just pdns-server,
      # pdns-backend-bind will install bind.conf instead.
      ucf_delete_unchanged "/etc/powerdns/pdns.d/pdns.simplebind.conf"
      backup_conffile "/etc/powerdns/pdns.d/pdns.simplebind.conf"
    fi
  ;;
esac