aboutsummaryrefslogtreecommitdiff
path: root/contrib/kiss-reporevdepends
blob: 1a83c33433286e251068a5460ef1cbf27336bc61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Display packages on the repository which depend on package
# shellcheck disable=2086

[ "$1" ] || {
    printf 'usage: %s <pkg>\n' "${0##*/}"
    exit 1
}

pkg="$1"
IFS=:; set -- $KISS_PATH; unset IFS

for repo do
    # Change directory to the upper directory of the repository
    # so it outputs packages in this nice looking format.
    # repository/package:
    cd "$repo/.." ||:
    # This grep only checks for the full word
    grep "^$pkg\$\|^$pkg\s" -- "${repo##*/}"/*/depends 2>/dev/null ||:
done