Debian Codegraph @

debian/autofs.postinst

raw
1 #!/bin/sh
2 set -e
3
4 if [ "$1" = "configure" ]; then
5 for file in auto.master auto.net auto.misc auto.smb autofs.conf default/autofs; do
6 # transfer ownership from old autofs5 package
7 case "`ucfq -w /etc/$file`" in
8 *:autofs5:*) force=--force ;;
9 *) force= ;;
10 esac
11 ucfr $force autofs /etc/$file
12 ucf /usr/share/autofs/conffiles/$file /etc/$file
13 done
14 fi
15
16 # In version 5.0.6 (wheezy), the package has been renamed
17 # from autofs5 to autofs. We properly Breaks/Replaces the old package,
18 # and dummy/transitional `autofs5' is also provided, so regular upgrades
19 # and new installs works. But when a system had old autofs5 installed
20 # and the user installs new autofs manually, the system ends up having
21 # config files of old autofs5, together with maintainer scripts, and
22 # this new autofs package. We need to ensure that old autofs5 package
23 # can be purged, but its maintscripts tries to deregister/remove
24 # ucf-controlled files, -- the same as we maintain above. We must stop
25 # it from doing so, and the only way we currently know to do that is to
26 # REMOVE old package's maintscripts to stop it from being executed.
27 # Suggested by Ben Hutchings and Steve Langasek. #686146
28 if [ "$1" = configure ]; then
29 if postrm="$(dpkg-query -c autofs5 postrm 2>/dev/null)" && [ -n "$postrm" ]
30 then
31 rm -f "$postrm"
32 fi
33 fi
34
35 #DEBHELPER#