aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.port.subdir.mk
diff options
context:
space:
mode:
authorjoe <joe@FreeBSD.org>2000-03-23 06:41:05 +0800
committerjoe <joe@FreeBSD.org>2000-03-23 06:41:05 +0800
commitc90135f71c47dab214c1fed23eb9a3f3826b618a (patch)
tree0bf73891fd3b55479f7f2564de2c841a07b0d438 /Mk/bsd.port.subdir.mk
parent6953d6e2cca2faefb39fbf2278a9adf98bd1ba11 (diff)
downloadfreebsd-ports-gnome-c90135f71c47dab214c1fed23eb9a3f3826b618a.tar.gz
freebsd-ports-gnome-c90135f71c47dab214c1fed23eb9a3f3826b618a.tar.zst
freebsd-ports-gnome-c90135f71c47dab214c1fed23eb9a3f3826b618a.zip
Rework the previous commit. The 'make search' mechanism will now work
with multi-level categories when we get them.
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;