aboutsummaryrefslogtreecommitdiff
path: root/contrib/cpt-depends
blob: 85b85065a7286d44970377455694808aa09ea9d1 (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 -ef
# Display a package's dependencies

## SYNOPSIS:
## .Nm
## .Op Ar pkg

## DESCRIPTION:
## .Nm
## displays the dependencies of the given
## .Em installed package .
## If no package name is given,
## .Nm
## will use the name of the current directory as the package.

case "$1" in
    --help|-h)
        printf 'usage: %s [pkg]\n' "${0##*/}"
        exit 0
        ;;
    '') set -- "${PWD##*/}"
esac

cpt-list "$1" >/dev/null
cat "$CPT_ROOT/var/db/cpt/installed/$1/depends" 2>/dev/null ||: