Date: Thu, 8 Nov 2001 20:12:37 -0500 (EST) From: Garance A Drosehn <gad@santropez.acs.rpi.edu> To: FreeBSD-gnats-submit@freebsd.org Cc: portmgr@FreeBSD.org.gad@freebsd.org Subject: ports/31862: [PATCH] 'make search' problem if /usr/obj/usr/ports/* exist Message-ID: <200111090112.fA91CbS52904@santropez.acs.rpi.edu>
next in thread | raw e-mail | index | archive | help
>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 <hopefully that worked...> mkdir -p /usr/obj/usr/ports make search name=bash <in my case, that does not work -- there is no output> cd shells make search name=bash <should work> mkdir -p /usr/obj/usr/ports/shells make search name=bash <back to no output> >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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200111090112.fA91CbS52904>