Debian Codegraph @

debian/falkon.postinst

raw
1 #!/bin/sh
2 set -e
3
4 QW_CVT=/usr/lib/qt5/bin/qwebengine_convert_dict
5
6 case "$1" in
7 configure)
8 # declare falkon as a possible web browser
9 update-alternatives --install /usr/bin/x-www-browser \
10 x-www-browser /usr/bin/falkon 80;
11
12 # take care of /usr/share/qt6/qtwebengine_dictionaries which
13 # comes with the package libqt6webengine6-data
14 if [ -L /usr/share/qt6/qtwebengine_dictionaries ]; then
15 # /usr/share/qt6/qtwebengine_dictionaries is a symlink
16 # repare it, when it is broken
17 realdir=$(realpath /usr/share/qt6/$(readlink /usr/share/qt6/qtwebengine_dictionaries))
18 if [ ! -d $realdir ]; then
19 # the symlink was broken, let's create its target
20 mkdir $realdir
21 fi
22 else
23 # /usr/share/qt6/qtwebengine_dictionaries is missing
24 # so let's create it as a symlink to /usr/share/hunspell-bdic
25 mkdir -p /usr/share/hunspell-bdic
26 if [ ! -e /usr/share/qt6/qtwebengine_dictionaries ]; then
27 ln -s ../hunspell-bdic /usr/share/qt6/qtwebengine_dictionaries
28 fi
29 fi
30 # convert existing hunspell dictionaries and install them
31 [ -f "$QW_CVT" ] && \
32 for f in /usr/share/hunspell/*.dic; do \
33 g=$(echo $(basename $f) | sed 's/dic$/bdic/'); \
34 g=/usr/share/qt6/qtwebengine_dictionaries/$g; \
35 if test ! -f $g || \
36 test $(stat -c%W "$g") -lt $(stat -c%W "$f"); then \
37 if ! $QW_CVT $f $g; then \
38 echo "Warning: there was an error when launching $QW_CVT $f $g"; \
39 fi; \
40 fi;\
41 done;
42 ;;
43 esac
44 #DEBHELPER#
45 exit 0