Date: Wed, 23 Mar 2005 21:15:59 -0500 From: Parv <parv@pair.com> To: "Michael C. Shultz" <ringworm01@gmail.com> Cc: freebsd-questions@freebsd.org Subject: "pkg_info -W" useless for symlink-accessible command (was Re: how to find which port has a given executable) Message-ID: <20050324021559.GA822@holestein.holy.cow> In-Reply-To: <200503230936.54842.ringworm01@gmail.com> References: <20050323173313.GA94954@rajarajan.homeunix.net> <200503230936.54842.ringworm01@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
in message <200503230936.54842.ringworm01@gmail.com>, wrote Michael C. Shultz thusly... > > pkg_info -W /usr/X11R6/bin/nedit > /usr/X11R6/bin/nedit was installed by package nedit-5.5 (I tried on 5.3-p5; used to have same issue on 4.6-4.11.) I always had problems w/ that as so far i tried only the file name, w/o the path. So "pkg_info -W /misc/local/bin/s2p" gives ... /misc/local/bin/s2p was installed by package perl-5.8.6_2 ... but "pkg_info -W s2p" produces nothing, even though the man page says ... -W For the specified filename argument show which package it belongs to. If the file is not in the current directory, and does not have an absolute path, then the PATH is searched using which(1). BTW, "which s2p" gives ... /usr/local/bin/s2p (where /usr/local is symlinked to /misc/local.) Apparently "pkg_info -W" is useless unless the *real path* is given. A quick/dirty wrapper would be (works in bash3 & sh) then ... for cmd in $@ do pkg_info -W $(realpath $(which $cmd)) done - Parv --
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20050324021559.GA822>