ports/104161: Let 'make search' also search in /usr/ports/MOVED
Lars Engels
lars.engels at 0x20.net
Sun Oct 8 13:20:18 UTC 2006
>Number: 104161
>Category: ports
>Synopsis: Let 'make search' also search in /usr/ports/MOVED
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Sun Oct 08 13:20:15 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator: Lars Engels
>Release: FreeBSD 7.0-CURRENT i386
>Organization:
>Environment:
System: FreeBSD bart.bsd-geek.de 7.0-CURRENT FreeBSD 7.0-CURRENT #11: Thu Oct 5 11:21:39 CEST 2006 lars at bart.bsd-geek.de:/usr/obj/usr/src/sys/BART i386
>Description:
When ports are moved, renamed or deleted, they're added to /usr/ports/MOVED.
Often they cannot be found with 'make search' afterwards.
The attached patch adds functionality to search in the MOVED file as well if you search for
'name=<name>'.
To prevent searching in MOVED, set PORTSEARCH_MOVED >= 0.
>How-To-Repeat:
>Fix:
--- search_moved.patch begins here ---
--- bsd.port.subdir.mk.orig Sun Oct 8 01:18:03 2006
+++ bsd.port.subdir.mk Sun Oct 8 14:59:24 2006
@@ -271,6 +271,8 @@
.else
INDEXFILE?= INDEX
.endif
+MOVEDDIR?= ${PORTSDIR}
+MOVEDFILE?= MOVED
HTMLIFY= sed -e 's/&/\&/g' -e 's/>/\>/g' -e 's/</\</g'
@@ -331,6 +333,7 @@
PORTSEARCH_KEYLIM?=0
PORTSEARCH_XKEYLIM?=0
PORTSEARCH_IGNORECASE?=1
+PORTSEARCH_MOVED?=1
_PORTSEARCH= \
here=${.CURDIR}; \
@@ -409,11 +412,11 @@
split(display, d, /,[ \t]*/); \
split(xdisplay, xd, /,[ \t]*/); \
for (i in d) { \
- toprint = 1;\
+ toprint = 1; \
for (j in xd) { \
if (d[i] == xd[j] ) { \
toprint=0; \
- break;\
+ break; \
}\
} \
if (toprint == 1 ) disp[fields[d[i]]] = 1; \
@@ -443,7 +446,31 @@
printf("%s:\t%s\n", names[i], $$i); \
print(""); \
}' ${INDEXDIR}/${INDEXFILE}; \
- fi
+ if [ "$$name" -o "$$xname" ] && [ ${PORTSEARCH_MOVED} -gt 0 ]; \
+ then \
+ awk -F\| -v name="$$name" -v xname="$$xname" \
+ -v icase="$${icase:-${PORTSEARCH_IGNORECASE}}" \
+ 'BEGIN { \
+ if (icase) { \
+ if (length(name)) name = tolower(name); if (length(xname)) xname = tolower(xname); \
+ } \
+ fields["name"] = 1; names[1] = "Port"; \
+ fields["destination"] = 2; names[2] = "Moved"; \
+ fields["date"] = 3; names[3] = "Date"; \
+ fileds["reason"] = 4; names[4] = "Reason"; \
+ } \
+ { \
+ oldname = $$1; newname = $$2; \
+ sub(".*\/", "", oldname); newname = sub(".*\/", "", newname); \
+ if (((icase ? tolower(oldname) : oldname) ~ name) || ((icase ? tolower(newname) : newname) ~ name)) { \
+ for (i = 1; i <= 4; i++) { \
+ printf("%s:\t%s\n", names[i], $$i); \
+ } \
+ print(""); \
+ } \
+ }' ${MOVEDDIR}/${MOVEDFILE}; \
+ fi \
+ fi
search:
@${_PORTSEARCH}
--- search_moved.patch ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list