summaryrefslogtreecommitdiff
path: root/debian/libsane1.postinst
blob: 7c747f6fc65f6b98db241fc92b4544deae676a9d (plain)
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
#!/bin/sh
set -e

# begin-remove-after: released:trixie
# protective diversion of files moved from / to /usr, to avoid file loss.
# Only for upgrades.
if [ "$1" = "configure" ]; then
    # At this point, the package will have installed the same file in */usr*.
    dpkg-divert --package usr-is-merged --no-rename \
        --divert /lib/udev/hwdb.d/20-sane.hwdb.usr-is-merged \
        --remove /lib/udev/hwdb.d/20-sane.hwdb
    dpkg-divert --package usr-is-merged --no-rename \
        --divert /lib/udev/rules.d/60-libsane1.rules.usr-is-merged \
        --remove /lib/udev/rules.d/60-libsane1.rules
    dpkg-divert --package usr-is-merged --no-rename \
        --divert /lib/udev/rules.d/99-libsane1.rules.usr-is-merged \
        --remove /lib/udev/rules.d/99-libsane1.rules
fi
# end-remove-after

case "$1" in
    configure)
    # Add the scanner system group if it doesn't exist
    if ! getent group | grep -q "^scanner:"; then
	echo "Adding scanner group..."
	addgroup --quiet --system scanner || true
    fi

    ;;

    abort-upgrade|abort-remove|abort-deconfigure)
    ;;

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


#DEBHELPER#