aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-message
blob: c8ac8656dde775c4194d6360e4c545a3042c7bb1 (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
#!/bin/sh

# Utility for showing package messages in the database.

[ "$1" ] || {
    printf '\033[1;33m-> \033[m%s\n' "usage: ${0##*/} [pkg] [pkg]"
    exit 0
}

for pkg do
    # Apply basename stripping so a user could run
    # 'kiss-message /var/db/kiss/installed/*' to see
    # all the messages on the system.
    pkg=${pkg##*/}
    msg="$KISS_ROOT/var/db/kiss/installed/$pkg/message"

    # Continue if no messages are available for the package.
    [ -f "$msg" ] || continue

    printf '%s\n\033[1m%s\033[m\n%s\n\n' \
           "==============================" \
           "$pkg" \
           "=============================="
    cat "$msg"
done