add whatprovides option (via xlocate)

This commit is contained in:
root@nirvana 2017-05-22 14:47:05 +02:00
parent f520a9f557
commit ec69b4b7f0
1 changed files with 12 additions and 0 deletions

12
vpm
View File

@ -210,6 +210,8 @@ usage () {
t "xbps-remove -v -O"
echo "autoremove (ar) - Remove orphaned packages"
t "xbps-remove -v -O"
echo "whatprovides (wp) <file> - Search for package containing <file>"
t "xlocate <pkg>"
echo "help - Show usage information"
echo "helppager (hp) - Show usage information (will pipe output to less/more)"
echo
@ -536,6 +538,16 @@ case "$arg" in
fi
;;
whatprovides|wp)
if hash xlocate >/dev/null 2>&1; then
shift
# set -x
# xlocate -S "$@"
msg "relaying to: \"xlocate $@\" - use xlocate -S to (re-)build cached DB."
xlocate "$@"
fi
;;
''|*)
a="$1"
if hash "xbps-${a}" >/dev/null 2>&1; then