From nnd@nnd.itfs.nsk.su  Tue Aug 27 00:43:12 2002
Return-Path: <nnd@nnd.itfs.nsk.su>
Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 146E637B400
	for <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <FreeBSD-gnats-submit@freebsd.org>; 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 <nnd@mail.nsk.ru>
Reply-To: Nickolay Dudorov <nnd@mail.nsk.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: "make search ..." may not work due to symlinks
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         42060
>Category:       ports
>Synopsis:       "make search ..." may not work due to symlinks
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Aug 27 00:50:01 PDT 2002
>Closed-Date:    Tue Sep 03 02:08:48 PDT 2002
>Last-Modified:  Tue Sep 03 02:08:48 PDT 2002
>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:
Responsible-Changed-From-To: freebsd-ports->portmgr 
Responsible-Changed-By: lioux 
Responsible-Changed-When: Tue Aug 27 09:04:57 PDT 2002 
Responsible-Changed-Why:  
Over to maintainer(s) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42060 
State-Changed-From-To: open->closed 
State-Changed-By: joe 
State-Changed-When: Tue Sep 3 02:08:39 PDT 2002 
State-Changed-Why:  
Committed.  Thanks. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=42060 
>Unformatted:
