File: phonon-backend-null.dc-config.in

package info (click to toggle)
phonon 4%3A4.9.0-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,216 kB
  • ctags: 2,532
  • sloc: cpp: 16,049; sh: 62; makefile: 58; xml: 32; awk: 22
file content (50 lines) | stat: -rw-r--r-- 2,130 bytes parent folder | download | duplicates (4)
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
# START CONFIG[phonon-null-backend/isnt_functional]

. /usr/share/debconf/confmodule

# This function will show a warning about phonon-backend-null whenever phonon
# metapackage or phonon-backend-null is being installed
warn_about_phonon_backend_null()
{
    local package=`basename "$0" .postinst`
    local show_warning=0
    local recommended_backend="#RECOMMENDED_BACKEND#"
    local other_backends

    # Do not show the note when reconfiguring
    if [ "$1" = "reconfigure" ] || [ "DEBCONF_RECONFIGURE" = "1" ]; then
        return 0
    fi

    if [ "$1" = "configure" ]; then
        # Display the warning only if both (phonon and phonon-backend-null)
        # are (about to be) installed. In order to avoid checking dpkg status
        # database, we can check Owners field of the debconf question.
        db_metaget phonon-backend-null/isnt_functional Owners
        OWNERS="`echo "$RET" | sed 's/, /\n/g'`"
        if echo "$OWNERS" | grep -q -e 'phonon$' -e 'phonon:' && echo "$OWNERS" | grep -q phonon-backend-null; then
            show_warning=1
        fi

        # Finally show the note if needed (and it wasn't seen already)
        db_fget phonon-backend-null/isnt_functional seen || true
        if [ "$RET" != "true" ] && [ "$show_warning" = "1" ]; then
            other_backends="`LC_ALL=C apt-cache showpkg phonon-backend | \
                            awk '/: *$/{go=0} {if (go==1) print $1;} /^Reverse Provides: *$/ {go=1}' | \
                            sort -u | \
                            grep -v -e phonon-backend-null -e "$recommended_backend" | \
                            awk '{printf ", " $1}'`"
            db_settitle phonon-backend-null/isnt_functional_title || true
            db_subst phonon-backend-null/isnt_functional recommended_backend "$recommended_backend"
            db_subst phonon-backend-null/isnt_functional other_backends "$other_backends"
            db_input high phonon-backend-null/isnt_functional || true
            db_go || true
        fi
    fi
}

warn_about_phonon_backend_null "$@"

# vim: set syntax=sh

# END CONFIG[phonon-null-backend/isnt_functional]