File: preinst

package info (click to toggle)
apsfilter 7.2.6-2
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 2,496 kB
  • sloc: sh: 450; ansic: 236; perl: 175; makefile: 159
file content (27 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (5)
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
#! /bin/sh -e

if [ "$1" = upgrade ] && dpkg --compare-versions "$2" lt-nl 6.0.0-1
then
  if [ -f /etc/printcap.orig ]
  then
    if [ -f /etc/printcap ]
    then
      mkdir -p /etc/apsfilter
      cp -p /etc/printcap /etc/apsfilter/printcap.dpkg-old
      rm -f /etc/printcap.old
    fi
    mv /etc/printcap.orig /etc/printcap
  fi

  rm -rf /var/lib/apsfilter/filter /var/lib/apsfilter/filters_found

  for conffile in /etc/apsfilterrc*
  do
    if [ -f "$conffile" ]
    then
      mv "$conffile" "/etc/apsfilter/${conffile##*/}.dpkg-old"
    fi
  done
fi

#DEBHELPER#