Date: Sun, 7 Nov 1999 02:19:30 -0800 (PST) From: reg@shale.csir.co.za To: FreeBSD-gnats-submit@freebsd.org Subject: ports/14760: bsd.port.mk: Speed-up for clean-depends Message-ID: <199911071019.CAA73838@granite.hip.berkeley.edu>
next in thread | raw e-mail | index | archive | help
>Number: 14760 >Category: ports >Synopsis: bsd.port.mk: Speed-up for clean-depends >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sun Nov 7 02:20:02 PST 1999 >Closed-Date: >Last-Modified: >Originator: Jeremy Lea >Release: FreeBSD 4.0-CURRENT i386 >Organization: Arb's Inc. >Environment: FreeBSD Ports collection. >Description: This patch significantly speeds up package-depends and clean-depends, through recursively calling depencies then only sorting the list and only calling the clean target once. >How-To-Repeat: >Fix: Index: bsd.port.mk =================================================================== RCS file: /usr/home/ncvs/ports/Mk/bsd.port.mk,v retrieving revision 1.323 diff -u -r1.323 bsd.port.mk --- bsd.port.mk 1999/10/10 17:19:49 1.323 +++ bsd.port.mk 1999/11/07 10:17:07 @@ -2328,24 +2499,32 @@ .endif +# Clean dependency lists: build and runtime. Print out directory names. + +clean-depends-list: + @${CLEAN-DEPENDS-LIST} + +CLEAN-DEPENDS-LIST= \ + checked="${PARENT_CHECKED}"; \ + for dir in $$(${ECHO} "${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//') $$(${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//'); do \ + if [ -d $$dir ]; then \ + if (${ECHO} $$checked | ${GREP} -qwv "$$dir"); then \ + child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" clean-depends-list); \ + for d in $$child; do ${ECHO} $$d; done; \ + ${ECHO} $$dir; \ + checked="$$dir $$child $$checked"; \ + fi; \ + else \ + ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \ + fi; \ + done | sort -u + .if !target(clean-depends) clean-depends: -.if defined(FETCH_DEPENDS) || defined(BUILD_DEPENDS) || defined(LIB_DEPENDS) \ - || defined(RUN_DEPENDS) - @for dir in `${ECHO} "${FETCH_DEPENDS} ${BUILD_DEPENDS} ${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u`; do \ - if [ -d $$dir ] ; then \ - (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \ - fi \ - done -.endif -.if defined(DEPENDS) - @for dir in `${ECHO} "${DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \ - if [ -d $$dir ] ; then \ - (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean clean-depends); \ - fi \ + @for dir in `${CLEAN-DEPENDS-LIST}`; do \ + (cd $$dir; ${MAKE} NOCLEANDEPENDS=yes clean); \ done .endif -.endif # Dependency lists: build and runtime. Print out directory names. @@ -2373,14 +2552,29 @@ fi; \ done | sort -u -# This one does not print out directory names -- it could take a long time. -package-depends: - @for dir in `${ECHO} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` `${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//' | sort -u`; do \ +# Clean dependency lists: build and runtime. Print out directory names. + +package-depends-list: + @${PACKAGE-DEPENDS-LIST} + +PACKAGE-DEPENDS-LIST= \ + checked="${PARENT_CHECKED}"; \ + for dir in $$(${ECHO} "${LIB_DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//') $$(${ECHO} ${DEPENDS} | ${TR} '\040' '\012' | ${SED} -e 's/:.*//'); do \ if [ -d $$dir ]; then \ - (cd $$dir ; ${MAKE} package-name package-depends); \ + if (${ECHO} $$checked | ${GREP} -qwv "$$dir"); then \ + child=$$(cd $$dir; ${MAKE} PARENT_CHECKED="$$checked" package-depends-list); \ + for d in $$child; do ${ECHO} $$d; done; \ + ${ECHO} $$dir; \ + checked="$$dir $$child $$checked"; \ + fi; \ else \ ${ECHO_MSG} "${PKGNAME}: \"$$dir\" non-existent -- dependency list incomplete" >&2; \ fi; \ + done | sort -u + +package-depends: + @for dir in `${PACKAGE-DEPENDS-LIST}`; do \ + (cd $$dir; ${MAKE} package-name); \ done ################################################################ >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199911071019.CAA73838>