File: libvlc-bin.postinst.in

package info (click to toggle)
vlc 3.0.21-0%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 205,696 kB
  • sloc: ansic: 441,073; cpp: 110,430; objc: 36,394; sh: 6,949; makefile: 6,603; javascript: 4,902; xml: 1,611; asm: 1,355; yacc: 640; python: 557; lex: 88; perl: 77; sed: 16
file content (34 lines) | stat: -rw-r--r-- 956 bytes parent folder | download | duplicates (3)
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
#!/bin/sh
set -e

run_vlc_cache_gen() {
    if ! test -d /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins
    then
        return
    fi
    files=`find /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins -name '*.so' -type f -print -quit`
    if test -n "$files"
    then
        # run vlc-cache-gen since there are plugins
        if ! /usr/lib/#DEB_HOST_MULTIARCH#/vlc/vlc-cache-gen /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins 2>&1
        then
            echo "WARNING: Regenerating VLC plugin cache failed."
            echo "Please run '/usr/lib/#DEB_HOST_MULTIARCH#/vlc/vlc-cache-gen /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins' manually."
        fi
    else
        # no plugins, so remove plugins.dat
        rm -f /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins/plugins.dat
    fi
}

case "$1" in
    triggered)
        run_vlc_cache_gen
        exit 0
        ;;
    configure)
        dpkg-trigger /usr/lib/#DEB_HOST_MULTIARCH#/vlc/plugins
        ;;
esac

#DEBHELPER#