From owner-freebsd-ports Tue Aug 27 0:50:12 2002 Delivered-To: freebsd-ports@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 028A937B400 for ; Tue, 27 Aug 2002 00:50:03 -0700 (PDT) Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 170E543E4A for ; Tue, 27 Aug 2002 00:50:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.4/8.12.4) with ESMTP id g7R7o1JU026595 for ; Tue, 27 Aug 2002 00:50:01 -0700 (PDT) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.4/8.12.4/Submit) id g7R7o1hK026594; Tue, 27 Aug 2002 00:50:01 -0700 (PDT) Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 146E637B400 for ; Tue, 27 Aug 2002 00:43:12 -0700 (PDT) Received: from nnd.itfs.nsk.su (nnd.itfs.nsk.su [212.20.32.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2CEE843E4A for ; Tue, 27 Aug 2002 00:43:10 -0700 (PDT) (envelope-from nnd@nnd.itfs.nsk.su) Received: from nnd.itfs.nsk.su (localhost [127.0.0.1]) by nnd.itfs.nsk.su (8.12.5/8.12.5) with ESMTP id g7R7i3eL003127 for ; Tue, 27 Aug 2002 14:44:03 +0700 (NOVST) (envelope-from nnd@nnd.itfs.nsk.su) Received: (from root@localhost) by nnd.itfs.nsk.su (8.12.5/8.12.5/Submit) id g7R7i2nx003126; Tue, 27 Aug 2002 14:44:02 +0700 (NOVST) Message-Id: <200208270744.g7R7i2nx003126@nnd.itfs.nsk.su> Date: Tue, 27 Aug 2002 14:44:02 +0700 (NOVST) From: Nickolay Dudorov Reply-To: Nickolay Dudorov To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/42060: "make search ..." may not work due to symlinks Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 42060 >Category: ports >Synopsis: "make search ..." may not work due to symlinks >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Aug 27 00:50:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: Nickolay Dudorov >Release: FreeBSD 5.0-CURRENT i386 >Organization: NTP Infoteka >Environment: System: FreeBSD nnd.itfs.nsk.su 5.0-CURRENT FreeBSD 5.0-CURRENT #35: Tue Aug 27 08:46:54 NOVST 2002 nnd@nnd.itfs.nsk.su:/arch/obj/usr/src/sys/NND i386 >Description: If PORTSDIR on your CURRENT system contains symlinks then "make search ..." command may not work as intended, i.e. not find any ports. >How-To-Repeat: Let's assume that on your system /usr/ports is a symlink to the /a/ports (for example). In this case following commands (in csh) give no results: cd /a/ports/shells make search key=bash >Fix: The problem is in the 'pwd' builtin command of the /bin/sh which (by default) prints "Logical" working directory while /bin/pwd and /bin/csh builtin pwd prints "Phisical" working directory by default. The next patch make it possible to "make search" in the ports hierarchy depite the symlinks in the PORTSDIR. Index: bsd.port.subdir.mk =================================================================== RCS file: /home/CVS/ports/Mk/bsd.port.subdir.mk,v retrieving revision 1.43 diff -b -u -r1.43 bsd.port.subdir.mk --- bsd.port.subdir.mk 5 Jul 2002 09:14:53 -0000 1.43 +++ bsd.port.subdir.mk 27 Aug 2002 07:16:39 -0000 @@ -252,7 +252,7 @@ search: ${PORTSDIR}/INDEX @here=`pwd`; \ cd ${PORTSDIR}; \ - top=`pwd`; \ + top=`pwd -P`; \ there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \ if [ -n "$$key" ]; then \ grep $$there ${PORTSDIR}/INDEX | grep -i "${key}" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'; \ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message