From owner-freebsd-questions@FreeBSD.ORG Thu Mar 24 02:16:04 2005 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E1D9016A4CE for ; Thu, 24 Mar 2005 02:16:04 +0000 (GMT) Received: from mta11.adelphia.net (mta11.adelphia.net [68.168.78.205]) by mx1.FreeBSD.org (Postfix) with ESMTP id 40EF843D31 for ; Thu, 24 Mar 2005 02:16:04 +0000 (GMT) (envelope-from parv@pair.com) Received: from default.chvlva.adelphia.net ([69.160.65.223]) by mta11.adelphia.netESMTP <20050324021603.TWRE5402.mta11.adelphia.net@default.chvlva.adelphia.net>; Wed, 23 Mar 2005 21:16:03 -0500 Received: by default.chvlva.adelphia.net (Postfix, from userid 1000) id B5570B4FC; Wed, 23 Mar 2005 21:15:59 -0500 (EST) Date: Wed, 23 Mar 2005 21:15:59 -0500 From: Parv To: "Michael C. Shultz" Message-ID: <20050324021559.GA822@holestein.holy.cow> Mail-Followup-To: "Michael C. Shultz" , freebsd-questions@freebsd.org References: <20050323173313.GA94954@rajarajan.homeunix.net> <200503230936.54842.ringworm01@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200503230936.54842.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) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Mar 2005 02:16:05 -0000 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 --