summaryrefslogtreecommitdiffstats
path: root/debian/libreoffice-common.postinst.in
blob: dd95adf44a64a46002103dda7e3cec7772341cc7 (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
42
43
#!/bin/sh

set -e

#INCLUDE_SHELL_LIB#

if [ "$1" = "triggered" ]; then
        for triggername in $2; do
                case "$triggername" in
                        # new "bundled" extensions (since 3.3)
                        "/@OODIR@/share/extensions")
                          make_lo_sync_extensions
                        ;;
                        "/@OODIR@")
                        # check also whether /usr/bin/loolwsd-systemplate-setup
                        # is +x do to not fail when it's gone but
                        # /var/lib/lool/systemplate is still there (loolwsd
			# removed but not purged)
                          if [ -x /usr/bin/loolwsd-systemplate-setup -a \
				-d /var/lib/lool/systemplate ]; then
                            update_lool_systemplate
                          fi
                        ;;
                esac
        done
fi

#DEBHELPER#

# do this manually since dpkg-maintscript-helper dir_to_symlink
# does not work reliably in this case because we cannot ensure that all
# conflicting packages previously shipping files in
# /usr/lib/libreoffice/share/registry are either upgraded or removed
# but not just deconfigured, see #985297
if [ "$1" = "configure" ] && dpkg --compare-versions "$2" lt-nl "1:7.0.4-4~" ; then
	if [ ! -L /usr/lib/libreoffice/share/registry ]; then
		if [ -d /usr/lib/libreoffice/share/registry ]; then
			# this will fail if the directory is not yet empty
			rmdir -v /usr/lib/libreoffice/share/registry
		fi
		ln -sfvT /etc/libreoffice/registry /usr/lib/libreoffice/share/registry
	fi
fi