From owner-freebsd-ports Thu Nov 8 17:20: 9 2001 Delivered-To: freebsd-ports@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 1287837B41B for ; Thu, 8 Nov 2001 17:20:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id fA91K1V08545; Thu, 8 Nov 2001 17:20:01 -0800 (PST) (envelope-from gnats) Received: from santropez.acs.rpi.edu (santropez.acs.rpi.edu [128.113.24.162]) by hub.freebsd.org (Postfix) with ESMTP id 6AC9537B416 for ; Thu, 8 Nov 2001 17:12:38 -0800 (PST) Received: (from gad@localhost) by santropez.acs.rpi.edu (8.11.6/8.11.4) id fA91CbS52904; Thu, 8 Nov 2001 20:12:37 -0500 (EST) (envelope-from gad) Message-Id: <200111090112.fA91CbS52904@santropez.acs.rpi.edu> Date: Thu, 8 Nov 2001 20:12:37 -0500 (EST) From: Garance A Drosehn Reply-To: Garance A Drosehn To: FreeBSD-gnats-submit@freebsd.org Cc: portmgr@FreeBSD.org.gad@freebsd.org X-Send-Pr-Version: 3.113 Subject: ports/31862: [PATCH] 'make search' problem if /usr/obj/usr/ports/* exist 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: 31862 >Category: ports >Synopsis: [PATCH] 'make search' problem if /usr/obj/usr/ports/* exist >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Nov 08 17:20:00 PST 2001 >Closed-Date: >Last-Modified: >Originator: Garance A Drosehn >Release: FreeBSD 4.4-STABLE i386 >Organization: RPI >Environment: System: FreeBSD santropez.acs.rpi.edu 4.4-STABLE FreeBSD 4.4-STABLE #0: Sat Oct 13 18:46:10 EDT 2001 root@santropez.acs.rpi.edu:/usr/obj/usr/src/sys/Dual-650P3 i386 Up-to-the-minute 'cvsup' of ports-all on a three-week-old build of 4.4-stable >Description: There are times when you do a 'make search name=bash' (for example) while in /usr/ports and it works fine. There are other times when I try it and it does not find anything. If I 'cd /usr/ports/shell' (in this example), it may work even if it doesn't work in /usr/ports. >How-To-Repeat: This may seem crazy, but try the following: if the directory /usr/obj/usr/ports exists, then either 'rm -Rf' it or just move it aside for this test. cd /usr/ports make search name=bash mkdir -p /usr/obj/usr/ports make search name=bash cd shells make search name=bash mkdir -p /usr/obj/usr/ports/shells make search name=bash >Fix: While trying to figure out what 'make search' does in the file /usr/ports/Mk/bsd.port.subdir.mk, I added a 'pwd' command (one that just prints out to the terminal). I noticed that if /usr/obj/usr/ports exists while I am in /usr/ports, then the 'pwd' command claimed THAT was the current directory. If it did not exist, then the 'pwd' found /usr/ports was the current directory. So, I added a quick&dirty change which seems to fix the problem (at least for the standard cases). The patch is tacked on the end of this PR. I assume that something is happening with the fancy magic of having an object directory (/usr/obj) which is separate from the source directory. I therefore suspect this patch is not strictly correct, depending on what environment variables have been set. I didn't want to figure out those details right now, but I wanted to write this up before I forgot. If no one else wants to look at this, I may have the time to figure out the details later this month (or certainly around christmas). I also don't know how this issue interacts with the one in PR 18455 (http://www.FreeBSD.org/cgi/query-pr.cgi?pr=ports/18455). Any attempt to fix the one should probably try to fix the other. Here's the quick and dirty lame-o patch (obviously the 'echo' is not necessary, it's just there to show what's going on): --- Mk/bsd.port.subdir.mk.orig Thu Jun 28 23:39:54 2001 +++ Mk/bsd.port.subdir.mk Thu Nov 8 19:12:02 2001 @@ -248,7 +248,8 @@ search: ${PORTSDIR}/INDEX - @here=`pwd`; \ + @echo "Search seems to start in `pwd`" + @here=`pwd|sed "s:^/usr/obj/:/:"`; \ cd ${PORTSDIR}; \ top=`pwd`; \ there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message