ports/63372: [PATCH] Fix for 'make search' when /usr/obj/usr/ports exists
Santropez &
root at santropez.netel.rpi.edu
Thu Feb 26 00:50:20 UTC 2004
>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 at 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 at 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:
More information about the freebsd-ports-bugs
mailing list