This file is indexed.

preinst is in libvirt-bin 4.0.0-1ubuntu8.

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
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
#!/bin/sh
# preinst script for libvirt-bin
#
# see: dh_installdeb(1)

# As of 1.3.3-2, libvirt-bin becomes a virtual package.  However, during
# the transition from libvirt-bin->libvirt-daemon-system, we also want to
# rename the libvirt-bin service unit to libvirtd.  We have to do the
# rename during the libvirt-bin preinst.

# If upgrading from << 1.3.3-2, manually move the old libvirt-bin
# service and socket over to libvirtd.
# This can be removed after 16.04 is released (though cloud archive
# may make it have to stick around longer).
# Note, for cloud archive upgrades on pre-15.10 releases, we may need
# to accomodate upstart installs.  Here those will break on the 'mv'.

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package

case "$1" in
    install|upgrade)
       if dpkg --compare-versions "$2" lt-nl "2.1.0-1ubuntu9~"; then
            if [ -d /run/systemd/system ]; then
                if deb-systemd-helper was-enabled libvirt-bin.service; then
                    touch /etc/libvirt/TMP_libvirt-bin-enabled
                else
                    touch /etc/libvirt/TMP_libvirt-bin-disabled
                fi
                deb-systemd-helper purge libvirt-bin.service
            fi

            invoke-rc.d libvirt-bin stop
       fi
    ;;

    # Do we need to reverse the above steps if aborting the upgrade?
    abort-upgrade)
    ;;

    install)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init/libvirt-bin.conf 2.5.0-3ubuntu8~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper mv_conffile /etc/cron.daily/libvirt-bin /etc/cron.daily/libvirt-daemon-system 2.1.0-1ubuntu9~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper mv_conffile /etc/dnsmasq.d-available/libvirt-bin /etc/dnsmasq.d-available/libvirt-daemon 2.1.0-1ubuntu9~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper mv_conffile /etc/default/libvirt-bin /etc/default/libvirtd 2.1.0-1ubuntu9~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/cron.daily/libvirt-bin 2.5.0-3ubuntu8~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/default/libvirt-bin 2.5.0-3ubuntu8~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/dnsmasq.d-available/libvirt-bin 2.5.0-3ubuntu8~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/apparmor.d/libvirt/TEMPLATE 2.5.0-3ubuntu8~ -- "$@"
# End automatically added section
# Automatically added by dh_installdeb/11.1.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/init.d/libvirt-bin 2.5.0-3ubuntu8~ -- "$@"
# End automatically added section


# After Debhelper / Maintscript helpers did their preinst work we need to
# untangle a special case.
# Due to bug 1694159 we need to handle a potential mv from pre
# 2.1.0-1ubuntu9~, but at the same time a RM from any later version.
# But MV and RM conflict, in case both run (=if upgrading former LTS).
# In those cases - and only if there was a custom config which is rare on
# those files - we want take back the RM (which made a backup), to let the MV
# be processed correctly.
# This section can be dropped with libvirt-bin >=18.10
case "$1" in
    install|upgrade)
        if dpkg --compare-versions "$2" lt-nl "2.1.0-1ubuntu9~"; then
            for CONFFILE in /etc/cron.daily/libvirt-bin /etc/dnsmasq.d-available/libvirt-bin /etc/default/libvirt-bin; do
                if [ -e "$CONFFILE.dpkg-backup" ]; then
                    mv -f "$CONFFILE.dpkg-backup" "$CONFFILE"
                fi
            done
        fi
        ;;
esac

exit 0