From owner-freebsd-ports-bugs@FreeBSD.ORG Wed Feb 25 16:50:19 2004 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D9E8B16A4D0 for ; Wed, 25 Feb 2004 16:50:19 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BFB6143D39 for ; Wed, 25 Feb 2004 16:50:19 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) i1Q0oJbv096253 for ; Wed, 25 Feb 2004 16:50:19 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.10/8.12.10/Submit) id i1Q0oJEx096252; Wed, 25 Feb 2004 16:50:19 -0800 (PST) (envelope-from gnats) Resent-Date: Wed, 25 Feb 2004 16:50:19 -0800 (PST) Resent-Message-Id: <200402260050.i1Q0oJEx096252@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Santropez & Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5A19216A4CE for ; Wed, 25 Feb 2004 16:41:31 -0800 (PST) Received: from santropez.netel.rpi.edu (santropez.netel.rpi.edu [128.113.24.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1014043D31 for ; Wed, 25 Feb 2004 16:41:31 -0800 (PST) (envelope-from root@santropez.netel.rpi.edu) Received: from santropez.netel.rpi.edu (localhost [127.0.0.1]) i1Q0fSdl025867 for ; Wed, 25 Feb 2004 19:41:28 -0500 (EST) (envelope-from root@santropez.netel.rpi.edu) Received: (from root@localhost) by santropez.netel.rpi.edu (8.12.11/8.12.11/Submit) id i1Q0fRCC025866; Wed, 25 Feb 2004 19:41:27 -0500 (EST) (envelope-from root) Message-Id: <200402260041.i1Q0fRCC025866@santropez.netel.rpi.edu> Date: Wed, 25 Feb 2004 19:41:27 -0500 (EST) From: Santropez & To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 Subject: ports/63372: [PATCH] Fix for 'make search' when /usr/obj/usr/ports exists X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Santropez & List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Feb 2004 00:50:20 -0000 >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 >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: