preinst is in gnu-fdisk 1.2.5-2.
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 | #!/bin/sh
set -e
check_divert() {
if [ -z "$(dpkg-divert --list $1)" ]; then
dpkg-divert --add --package gnu-fdisk --rename \
--divert $1.distrib $1
fi
}
if [ "$1" = "install" ] || [ "$1" = "upgrade" ]
then
# Fix previous divert mistake cfdisk.8.gz.distrib instead of cfdisk.distrib.8.gz
if [ ! -z "$(dpkg-divert --list /usr/share/man/man8/cfdisk.8.gz.distrib)" ]; then
dpkg-divert --remove --package gnu-fdisk /usr/share/man/man8/cfdisk.8.gz
fi
if [ ! -z "$(dpkg-divert --list /usr/share/man/man8/fdisk.8.gz.distrib)" ]; then
dpkg-divert --remove --package gnu-fdisk /usr/share/man/man8/fdisk.8.gz
fi
#####
if [ -z "$(dpkg-divert --list /usr/share/man/man8/cfdisk.distrib.8.gz)" ]; then
dpkg-divert --add --package gnu-fdisk --rename \
--divert /usr/share/man/man8/cfdisk.distrib.8.gz \
/usr/share/man/man8/cfdisk.8.gz
fi
if [ -z "$(dpkg-divert --list /usr/share/man/man8/fdisk.distrib.8.gz)" ]; then
dpkg-divert --add --package gnu-fdisk --rename \
--divert /usr/share/man/man8/fdisk.distrib.8.gz \
/usr/share/man/man8/fdisk.8.gz
fi
check_divert /sbin/fdisk
check_divert /sbin/cfdisk
fi
|