7.8.4 ‘pkg_owner()

This function can be used to determine the owner of a package. The first argument is used for flags that will be passed to ‘grep’, and the second one is for the file query. Rest of the arguments can be used in order to specify the manifests to be used, but it is optional. ‘pkg_owner()’ will search for all the installed packages if no other arguments are given.

# Example
pkg_owner -lFx /usr/bin/grep  # Returns 'busybox'

# An example call made by `pkg_fix_deps()` to figure out whether the built
# package contains the file it depends.
pkg_owner -l "/${dep#/}\$" "$PWD/manifest" >/dev/null && continue
pkg_owner -l "/${dep#/}\$" "$@" ||: