Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 25 Feb 2004 19:41:27 -0500 (EST)
From:      Santropez & <root@santropez.netel.rpi.edu>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   ports/63372: [PATCH] Fix for 'make search' when /usr/obj/usr/ports exists
Message-ID:  <200402260041.i1Q0fRCC025866@santropez.netel.rpi.edu>
Resent-Message-ID: <200402260050.i1Q0oJEx096252@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         63372
>Category:       ports
>Synopsis:       [PATCH] Fix for 'make search' when /usr/obj/usr/ports exists
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Feb 25 16:50:19 PST 2004
>Closed-Date:
>Last-Modified:
>Originator:     Garance A Drosehn <gad@santropez.netel.rpi.edu>
>Release:        FreeBSD 5.2-CURRENT i386
>Organization:
RPI, Troy NY.
>Environment:
System: FreeBSD santropez.netel.rpi.edu 5.2-CURRENT FreeBSD 5.2-CURRENT #0: Mon Feb 16 18:26:53 EST 2004 root@santropez.netel.rpi.edu:/usr/obj/usr/src/sys/Dual-Athlon2k i386


	The problem happens on multiple machines, multiple releases
	of FreeBSD.

>Description:
	This is a repeat of PR 31862 from Nov 2001 (where the fix was
	thought to have been committed in Apr 2002, but never really was).
	Given that few people seem to be bothered by this, it must be that
	I'm the only nut who creates /usr/obj/usr/ports/...

	Anyway, go into /usr/ports, and do a 'make search key=whatever'.
	It will probably work fine for you.  Now, do a command like:
		mkdir -p /usr/obj/`pwd`
	and repeat the exact same 'make search key=whatever'.  You will
	now get zero results.

>How-To-Repeat:
	The way I actually cause this problem is I have my own subdirectory
	of fake ports.  For some of those "ports", I do:  make obj
	That creates the /usr/obj/... directory for my fake port, and in
	the process it creates /usr/obj/usr/ports which screws up the
	'make search' target.

>Fix:

	Here is a fix that works for me.  I am not sure how well it would
	work if various directories are symlinks to other directories.

--- bsd.port.subdir.mk.orig	Tue Feb  3 23:27:04 2004
+++ bsd.port.subdir.mk	Wed Feb 25 19:06:20 2004
@@ -318,9 +318,9 @@
 .endif
 
 
-
+#  (avoid using `pwd` for 'here' due to the case where /usr/obj/`pwd` exists)
 search: ${PORTSDIR}/${INDEXFILE}
-	@here=`pwd`; \
+	@here=${.CURDIR}; \
 	cd ${PORTSDIR}; \
 	top=`pwd -P`; \
 	there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402260041.i1Q0fRCC025866>