aboutsummaryrefslogtreecommitdiff
path: root/Mk/bsd.port.subdir.mk
diff options
context:
space:
mode:
authorJosef Karthauser <joe@FreeBSD.org>2000-03-22 22:41:05 +0000
committerJosef Karthauser <joe@FreeBSD.org>2000-03-22 22:41:05 +0000
commitd14040e21841517efa90a751053ca9c787581ff0 (patch)
tree9b2d6f8d2a15e13d1e8cd9ee40152e708890de80 /Mk/bsd.port.subdir.mk
parent004bdf6c668f4dd6c73ad5928a70fd8c1a8b5ec9 (diff)
downloadports-d14040e21841517efa90a751053ca9c787581ff0.tar.gz
ports-d14040e21841517efa90a751053ca9c787581ff0.zip
Rework the previous commit. The 'make search' mechanism will now work
with multi-level categories when we get them.
Notes
Notes: svn path=/head/; revision=26966
Diffstat (limited to 'Mk/bsd.port.subdir.mk')
-rw-r--r--Mk/bsd.port.subdir.mk31
1 files changed, 15 insertions, 16 deletions
diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk
index 8887b3102fe8..b0b9a937d54c 100644
--- a/Mk/bsd.port.subdir.mk
+++ b/Mk/bsd.port.subdir.mk
@@ -239,20 +239,19 @@ README.html:
PORTOBJFORMAT="${PORTOBJFORMAT:S/"/"'"'"/g:S/\$/\$\$/g:S/\\/\\\\/g}"
.endif
-# Ports may be symlinked to somewhere else. Convert the directory path
-# back into one that lives within the ports collection.
-PORTSACTUALDIR!=perl -e '($$subdir = "${.CURDIR}") =~ s!.*/([^/]+)!$$1/!; \
- print "${PORTSACTUALDIR}/"; print $$subdir unless "${PORTSTOP}";'
+
+
search: ${PORTSDIR}/INDEX
-.if !defined(key) && !defined(name)
- @echo "The search target requires a keyword parameter or name parameter,"
- @echo "e.g.: \"make search key=somekeyword\""
- @echo "or \"make search name=somekeyword\""
-.else
-.if defined(key)
- @grep ${PORTSACTUALDIR} ${PORTSDIR}/INDEX | grep -i "${key}" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'
-.endif
-.if defined(name)
- @grep ${PORTSACTUALDIR} ${PORTSDIR}/INDEX | grep -i "^[^|]*${name}[^|]*|" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'
-.endif
-.endif
+ @here=`pwd`; \
+ cd ${PORTSDIR}; \
+ top=`pwd`; \
+ there=`echo "$$here/" | sed s%$$top%${PORTSDIR}%`; \
+ if [ $$key ]; then \
+ grep $$there ${PORTSDIR}/INDEX | grep -i "${key}" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'; \
+ elif [ $$name ]; then \
+ grep $$there ${PORTSDIR}/INDEX | grep -i "^[^|]*${name}[^|]*|" | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9); }'; \
+ else \
+ echo "The search target requires a keyword parameter or name parameter,"; \
+ echo "e.g.: \"make search key=somekeyword\""; \
+ echo "or \"make search name=somekeyword\""; \
+ fi;