File: libglib2.0-0.postinst.in

package info (click to toggle)
glib2.0 2.78.4-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,024 kB
  • sloc: ansic: 495,608; xml: 17,404; python: 9,572; perl: 1,144; sh: 1,094; cpp: 487; makefile: 225
file content (52 lines) | stat: -rw-r--r-- 1,606 bytes parent folder | download | duplicates (2)
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
44
45
46
47
48
49
50
51
52
#!/bin/sh
set -e


handle_triggers () {
    local trigger
    local dirs

    for trigger in "$@"; do
        if ! [ -d $trigger ]; then
            continue
        fi
        case $trigger in
          /usr/share/glib-2.0/schemas)
            # This is triggered everytime an application installs a
            # GSettings schema
            "/usr/lib/#MULTIARCH#/glib-2.0/glib-compile-schemas" /usr/share/glib-2.0/schemas || true
            ;;

          "/usr/lib/#MULTIARCH#/gio/modules")
            # This is triggered everytime an application installs a GIO
            # module into /usr/lib/#MULTIARCH#/gio/modules

            "/usr/lib/#MULTIARCH#/glib-2.0/gio-querymodules" "/usr/lib/#MULTIARCH#/gio/modules" || true
            ;;
        esac
    done
}

if [ "$1" = triggered ]; then
    handle_triggers $2
    exit 0
fi

#DEBHELPER#

# This is shipped in the .deb (see debian/libglib2.0-0.dirs) but would
# be removed if empty during upgrade by old versions of the postrm (#987913).
# This workaround can be removed after Debian 12 and Ubuntu 22.04 are released.
install -d "/usr/lib/#MULTIARCH#/gio/modules"

"/usr/lib/#MULTIARCH#/glib-2.0/glib-compile-schemas" /usr/share/glib-2.0/schemas || true
"/usr/lib/#MULTIARCH#/glib-2.0/gio-querymodules" "/usr/lib/#MULTIARCH#/gio/modules" || true

# Clean up pre-multiarch giomodule.cache.
# This workaround can be removed after Debian 12 and Ubuntu 22.04 are released.
if [ -d /usr/lib/gio/modules ]; then
    rm -f /usr/lib/gio/modules/giomodule.cache
    rmdir -p --ignore-fail-on-non-empty /usr/lib/gio/modules
fi

# vim:set sw=4 sts=4 et: