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
|
#! /bin/sh
# preinst script for cupsys
#
# see: dh_installdeb(1)
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>
case "$1" in
install)
;;
upgrade)
if [ -e /var/lib/cups/conf -a ! -L /var/lib/cups/conf -a ! -e /etc/cups ]; then
echo -n "Moving configuration files..."
mkdir -p /etc/cups || true
if [ `ls /var/lib/cups/conf | wc -l` -ne " 0" ]; then
cp -a /var/lib/cups/conf/* /etc/cups
fi
rm -rf /var/lib/cups/conf
echo "done."
fi
if [ -e /var/lib/cups/ppd -a ! -L /var/lib/cups/ppd -a ! -e /etc/cups/ppd ]; then
echo -n "Moving printer definition files..."
mkdir -p /etc/cups/ppd || true
if [ `ls /var/lib/cups/ppd | wc -l` -ne " 0" ]; then
cp -a /var/lib/cups/ppd/* /etc/cups/ppd
fi
rm -rf /var/lib/cups/ppd
echo "done."
fi
if [ -e /var/lib/cups/logs -a ! -L /var/lib/cups/logs ]; then
rmdir /var/lib/cups/logs || true;
fi
;;
abort-upgrade)
;;
*)
echo "preinst called with unknown argument \`$1'" >&2
exit 0
;;
esac
# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.
#DEBHELPER#
exit 0
|