=================================================================== RCS file: /cvsrepo/anoncvs/cvs/ports/Makefile,v retrieving revision 1.69 retrieving revision 1.82 diff -u -r1.69 -r1.82 --- ports/Makefile 2012/05/28 09:38:04 1.69 +++ ports/Makefile 2018/11/16 09:30:47 1.82 @@ -1,17 +1,18 @@ -# $OpenBSD: Makefile,v 1.69 2012/05/28 09:38:04 espie Exp $ -# $FreeBSD: Makefile,v 1.36 1997/10/04 15:54:31 jkh Exp $ -# +# $OpenBSD: Makefile,v 1.82 2018/11/16 09:30:47 espie Exp $ +.if !defined(BSD_OWN_MK) +. include +.endif + PKGPATH = -MIRROR_MK ?= ${.CURDIR}/distfiles/Makefile DISTFILES_DB ?= ${.CURDIR}/infrastructure/db/locate.database +INDEX = ${LOCALBASE}/share/ports-INDEX .if defined(SUBDIR) # nothing to do -.elif defined(key) || defined(name) || defined(category) || defined(author) - +.elif !make(search) && (defined(key) || defined(name) || defined(category) || defined(author)) # set up subdirs from the index, assume it's up-to-date -_CMD = perl ${.CURDIR}/infrastructure/bin/retrieve-index index='${.CURDIR}/INDEX' +_CMD = perl ${.CURDIR}/infrastructure/bin/port-search-helper index='${INDEX}' . if defined(key) _CMD += key='${key}' . endif @@ -59,11 +60,9 @@ SUBDIR += multimedia SUBDIR += net SUBDIR += news -SUBDIR += palm SUBDIR += plan9 SUBDIR += print SUBDIR += productivity -SUBDIR += russian SUBDIR += security SUBDIR += shells SUBDIR += sysutils @@ -75,34 +74,40 @@ .include -index: - @rm -f ${.CURDIR}/INDEX - @${_MAKE} ${.CURDIR}/INDEX +${INDEX}: + @echo "Please install portslist" + @echo "${SUDO} pkg_add portslist" + @exit 1 -${.CURDIR}/INDEX: - @echo "Generating INDEX..." - @${_MAKE} describe MACHINE_ARCH=i386 ECHO_MSG="echo 1>&2" > ${.CURDIR}/INDEX - @echo "Done." -print-index: ${.CURDIR}/INDEX - @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${.CURDIR}/INDEX +print-index: ${INDEX} + @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${INDEX} -print-licenses: ${.CURDIR}/INDEX +print-licenses: ${INDEX} @printf "Port PC PF DC DF Maint\n" - @awk -F\| '{printf("%-40.39s%-3.2s%-3.2s%-3.2s%-3.2s%-25.25s\n",$$2,$$12,$$13,$$14,$$15,$$6);}' < ${.CURDIR}/INDEX + @awk -F\| '{printf("%-40.39s%-3.2s%-3.2s%-3.2s%-3.2s%-25.25s\n",$$2,$$12,$$13,$$14,$$15,$$6);}' < ${INDEX} -search: ${.CURDIR}/INDEX +search: ${INDEX} .if !defined(key) && !defined(name) @echo "The search target requires a keyword or name parameter," @echo "e.g.: \"make search key=somekeyword\" \"make search name=somename\"" .else . if defined(key) - @egrep -i -- "${key}" ${.CURDIR}/INDEX | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }' + @egrep -i -- "${key}" ${INDEX} | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }' . else - @awk -F\| '$$1 ~ /${name}/ { printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }' ${.CURDIR}/INDEX + @awk -F\| '$$1 ~ /${name}/ { printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }' ${INDEX} . endif .endif +fix-permissions: + @{ echo "COMMENT=test"; \ + echo "CATEGORIES=test"; \ + echo "PKGPATH=test/a"; \ + echo "DISTNAME=test"; \ + echo "PERMIT_PACKAGE_CDROM=Yes"; \ + echo "ECHO_MSG=:"; \ + echo ".include "; }|${MAKE} -f - fix-permissions + homepages.html: @echo '
    ' >$@ @${_MAKE} homepage-links ECHO_MSG='echo >&2' >>$@ @@ -116,4 +121,4 @@ >${.CURDIR}/packages/${MACHINE_ARCH}/ftp/pkglocatedb .PHONY: index search distfiles-update-locatedb \ - pkglocatedb print-licenses print-index + pkglocatedb print-licenses print-index fix-permissions