aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-message
blob: f29c8a51241ae5c8ea90b9c382da1cbf553d73cd (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
#!/bin/sh
# Show messages from a package in the system 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