root@molly:/usr/ports#pkg_info -W /usr/local/bin/sudo
/usr/local/bin/sudo was installed by package sudo-1.7.2.5
Google :eda1 said:how would I figure out which package/port to install in order to get the file ?
phoenix said:$ grep filename /usr/ports/*/*/pkg-plist
May take a long time to run.And won't work for ports that use auto-generated plists.
phoenix said:$ grep filename /usr/ports/*/*/pkg-plist
May take a long time to run.And won't work for ports that use auto-generated plists.
# find /usr/ports -name pkg-plist -exec grep filename {} \+
# cd /usr/ports && make search key=filename
wblock said:That gives "/usr/bin/grep: Argument list too long." Have to resort to find:
# find /usr/ports -name pkg-plist -exec grep filename {} \+
jalla said:If you had your ports tree around for a few days, this is probably the fastest
Code:locate filename |grep 'usr/ports'
pkg_info -L libXi-1.2.1,1
[...]
/usr/local/lib/libXi.so.6
[...]
wblock said:But that won't look in the pkg-plist files. It would work to find the port that uses a certain distfile or patch file.
phoenix said:Hrm, yeah, guess that would be along argument list.
Wonder how the speed would compare to (find vs xargs) (completely untested):
Nevermind, that also gives argument list too long.
xargs -L
to limit the cmd.gnome:/usr/ports# time eval "find . -name pkg-plist | xargs grep whatever"
./databases/mantis/pkg-plist:%%WWWDIR%%/library/ezc/Base/src/exceptions/whatever.php
./games/lucidlife/pkg-plist:%%DATADIR%%/patterns/jslife/odds_&_ends/whatever.glf
./sysutils/gsmartcontrol/pkg-plist:%%PORTDOCS%%%%DOCSDIR%%/LICENSE_whatever.txt
./textproc/stardict2-rptts/pkg-plist:share/WyabdcRealPeopleTTS/w/whatever.wav
./textproc/yodl/pkg-plist:bin/yodl2whatever
./textproc/yodl/pkg-plist:%%NO_MANPAGES%%man/man1/yodl2whatever.1.gz
1.543u 7.433s 2:33.86 5.8% 34+810k 52613+0io 0pf+0w
pkg provides bin/firefox$
and any other combination from the man page always returns
pkg: unkown command: provides