summaryrefslogtreecommitdiffstats
path: root/src/hooks/arch
blob: c5d0587ce552e096959a0a695bf6b178c6621be8 (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
. /etc/rc.conf
. /etc/rc.d/functions

### Logging/Error reporting for Arch Linux

function report_err {
    printhl "$*"
}

function report_warn {
    printhl "$*"
}

function report_try {
    stat_busy "$*"
    REPORT_TRYING=1
}

function report_fail {
    if [[ -n "$*" ]]; then
        if [[ -n "$REPORT_TRYING" ]]; then
            stat_append "- $*"
            REPORT_TRYING=
            stat_fail
        else
            printhl "$*"
        fi
    elif [[ -n "$REPORT_TRYING" ]]; then
        REPORT_TRYING=
        stat_fail
    fi
}

function report_success {
    if [[ -n "$*" ]]; then
        stat_append "- $*"
        REPORT_TRYING=
    fi
    stat_done
}

# vim: ft=sh ts=4 et sw=4: