Vice versa of 'pkg_info -W'

rank1seeker at gmail.com rank1seeker at gmail.com
Thu Jan 3 14:45:10 UTC 2013


> rank1seeker at gmail.com wrote:
> 
> >For example:
> ># pkg_info -W /usr/local/bin/lynx
> >/usr/local/bin/lynx was installed by package lynx-2.8.7.2,1
> >
> ># pkg_deinstall lynx-2.8.7.2,1
> >
> ># pkg_info -W /usr/local/bin/lynx
> >pkg_info: /usr/local/bin/lynx: file cannot be found
> >
> >
> >As you can figure it out, I want a reverse method, that is ...
> >If I want to have '/usr/local/bin/lynx' installed, which port
> >origin(s), would install it?
> 
> The portsearch port will do that.
> 

Well, it works prety much as:


> Well, in the case of lynx, where the filename of the executable matches
> the package name, it's fairly simple:
> 
> lucid-nonsense:/usr/ports:% cd /usr/ports
> lucid-nonsense:/usr/ports:% make search name=lynx
> Port:	ja-lynx-2.8.7.r1
> Path:	/usr/ports/japanese/lynx
> Info:	A terminal-based World-Wide Web Client with multi-byte modification
> Maint:	ports at FreeBSD.org
> B-deps:	libiconv-1.14
> R-deps:	libiconv-1.14
> WWW:	http://lynx.isc.org/current/
> 
> Port:	ja-lynx-2.8.8.d3
> Path:	/usr/ports/japanese/lynx-current
> Info:	A terminal-based World-Wide Web Client with multi-byte
> modification (development version)
> Maint:	ports at FreeBSD.org
> B-deps:	libiconv-1.14
> R-deps:	libiconv-1.14
> WWW:	http://lynx.isc.org/current/
> 
> Port:	lynx-2.8.7.2,1
> Path:	/usr/ports/www/lynx
> Info:	A non-graphical, text-based World-Wide Web client
> Maint:	jharris at widomaker.com
> B-deps:	gettext-0.18.1.1 libiconv-1.14 openssl-1.0.1_4
> R-deps:	gettext-0.18.1.1 libiconv-1.14 openssl-1.0.1_4
> WWW:	http://lynx.isc.org/
> 
> Port:	lynx-2.8.8d12_1
> Path:	/usr/ports/www/lynx-current
> Info:	A non-graphical, text-based World-Wide Web client
> Maint:	johans at FreeBSD.org
> B-deps:	gettext-0.18.1.1 libiconv-1.14 libidn-1.25 openssl-1.0.1_4
> pkgconf-0.8.9
> R-deps:	gettext-0.18.1.1 libiconv-1.14 libidn-1.25 mime-support-3.52.2
> openssl-1.0.1_4 pkgconf-0.8.9
> WWW:	http://lynx.isc.org/current/
> 

I slightly hopped '-p path' flag of a portsearch would to the trick, but it counts for '/usr/ports/*' path.
Not to the path of a binary.

> 
> However, in the general case, there isn't (as far as I know) a database
> of all of the files installed by all of the packages that can be
> generated from the ports.

Unfortunately.
I've attempted to grep '/usr/ports/*/*/pkg-plist' for 'bin/lynx' and shot myself in a foot! :P
Even if it did returned "sane" amount of matches, speed was atrocious.

> I believe bapt@ had plans to gather this sort of data on the
> yet-to-be-commisioned pkgng build cluster.  As that's currently out of
> action as a consequence of the security incident, and the whole package
> building system is being revised, I don't know if that's still on the
> cards or likely to be implemented any time soon.
> 
> 	Cheers,
> 
> 	Matthew

I see. But for this to work, DB is mandatory.


Domagoj Smolčić


More information about the freebsd-hackers mailing list