diff options
author | hubertf <hubertf> | 1998-02-20 21:31:20 +0000 |
---|---|---|
committer | hubertf <hubertf> | 1998-02-20 21:31:20 +0000 |
commit | 38f76184c598f25da9746743e02ea0f4f13fa279 (patch) | |
tree | 6c2502ff42793d1fb54ed956db92815377ac5161 /mk | |
parent | 24f102b9f24fab6c67e6f2f806c3260dc53a9d41 (diff) | |
download | pkgsrc-38f76184c598f25da9746743e02ea0f4f13fa279.tar.gz |
Recursively print /bin/sh code for all dependent package as well as the
current package (IF called from a package dir and not via bsd.port.subdir.mk;
in the latter case it's assumed that the dependent packages will be scanned
later anyways).
This fixes PR 4992 by Mario Kemper <magick@bundy.lip.owl.de>.
Diffstat (limited to 'mk')
-rw-r--r-- | mk/bsd.pkg.mk | 49 | ||||
-rw-r--r-- | mk/bsd.port.mk | 49 |
2 files changed, 70 insertions, 28 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index ffd4aeae78a..de2f0e5ab4d 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,7 +1,7 @@ #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # -# $NetBSD: bsd.pkg.mk,v 1.47 1998/02/20 21:01:09 hubertf Exp $ +# $NetBSD: bsd.pkg.mk,v 1.48 1998/02/20 21:31:20 hubertf Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1480,32 +1480,53 @@ distclean: pre-distclean clean # Prints out a list of files to fetch (useful to do a batch fetch) +# are we called from bsd.port.subdir.mk (i.e. do we scan all dirs anyways)? XXX +.ifdef(DIRPRFX) +RECURSIVE_FETCH_LIST?= NO +.else +RECURSIVE_FETCH_LIST?= YES +.endif + .if !target(fetch-list) fetch-list: - @${MKDIR} ${_DISTDIR} - @(cd ${_DISTDIR}; \ - for file in ${DISTFILES}; do \ + @${MAKE} fetch-list-recursive RECURSIVE_FETCH_LIST=${RECURSIVE_FETCH_LIST} | sort -u +.endif # !target(fetch-list) + +.if !target(fetch-list-recursive) +fetch-list-recursive: + @${MAKE} fetch-list-one-pkg +.if ${RECURSIVE_FETCH_LIST} != "NO" + @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${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 \ + (cd $$dir; ${MAKE} fetch-list-recursive; ); \ + done +.endif # ${RECURSIVE_FETCH_LIST} != "NO" +.endif # !target(fetch-list-recursive) + +.if !target(fetch-list-one-pkg) +fetch-list-one-pkg: + @for file in ${DISTFILES}; do \ + [ -z "${DIST_SUBDIR}" ] || ${ECHO} -n "${MKDIR} ${DIST_SUBDIR} && cd ${DIST_SUBDIR} && " ; \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ - for site in ${MASTER_SITES}; do \ - ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ - break; \ + ${ECHO} -n "[ -f $$file -o -f `${BASENAME} $$file` ] || " ; \ + for site in ${MASTER_SITES} ; do \ + ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \ done; \ ${ECHO} "echo $${file} not fetched" ; \ fi \ - done) + done .if defined(PATCHFILES) @(cd ${_DISTDIR}; \ - for file in ${PATCHFILES}; do \ + for file in ${PATCHFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ + ${ECHO} -n "[ -f $$file -o -f `${BASENAME} $$file` ] || " ; \ for site in ${PATCH_SITES}; do \ - ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ - break; \ + ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \ done; \ ${ECHO} "echo $${file} not fetched" ; \ fi \ - done) -.endif -.endif + done) +.endif # defined(PATCHFILES) +.endif # !target(fetch-list-one-pkg) # Checksumming utilities diff --git a/mk/bsd.port.mk b/mk/bsd.port.mk index 53f09bd8a01..78ca1c3fc87 100644 --- a/mk/bsd.port.mk +++ b/mk/bsd.port.mk @@ -1,7 +1,7 @@ #-*- mode: Fundamental; tab-width: 4; -*- # ex:ts=4 # -# $NetBSD: bsd.port.mk,v 1.47 1998/02/20 21:01:09 hubertf Exp $ +# $NetBSD: bsd.port.mk,v 1.48 1998/02/20 21:31:20 hubertf Exp $ # # bsd.port.mk - 940820 Jordan K. Hubbard. # This file is in the public domain. @@ -1480,32 +1480,53 @@ distclean: pre-distclean clean # Prints out a list of files to fetch (useful to do a batch fetch) +# are we called from bsd.port.subdir.mk (i.e. do we scan all dirs anyways)? XXX +.ifdef(DIRPRFX) +RECURSIVE_FETCH_LIST?= NO +.else +RECURSIVE_FETCH_LIST?= YES +.endif + .if !target(fetch-list) fetch-list: - @${MKDIR} ${_DISTDIR} - @(cd ${_DISTDIR}; \ - for file in ${DISTFILES}; do \ + @${MAKE} fetch-list-recursive RECURSIVE_FETCH_LIST=${RECURSIVE_FETCH_LIST} | sort -u +.endif # !target(fetch-list) + +.if !target(fetch-list-recursive) +fetch-list-recursive: + @${MAKE} fetch-list-one-pkg +.if ${RECURSIVE_FETCH_LIST} != "NO" + @for dir in `${ECHO} ${FETCH_DEPENDS} ${BUILD_DEPENDS} ${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 \ + (cd $$dir; ${MAKE} fetch-list-recursive; ); \ + done +.endif # ${RECURSIVE_FETCH_LIST} != "NO" +.endif # !target(fetch-list-recursive) + +.if !target(fetch-list-one-pkg) +fetch-list-one-pkg: + @for file in ${DISTFILES}; do \ + [ -z "${DIST_SUBDIR}" ] || ${ECHO} -n "${MKDIR} ${DIST_SUBDIR} && cd ${DIST_SUBDIR} && " ; \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ - for site in ${MASTER_SITES}; do \ - ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ - break; \ + ${ECHO} -n "[ -f $$file -o -f `${BASENAME} $$file` ] || " ; \ + for site in ${MASTER_SITES} ; do \ + ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \ done; \ ${ECHO} "echo $${file} not fetched" ; \ fi \ - done) + done .if defined(PATCHFILES) @(cd ${_DISTDIR}; \ - for file in ${PATCHFILES}; do \ + for file in ${PATCHFILES}; do \ if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ + ${ECHO} -n "[ -f $$file -o -f `${BASENAME} $$file` ] || " ; \ for site in ${PATCH_SITES}; do \ - ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '||' ; \ - break; \ + ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \ done; \ ${ECHO} "echo $${file} not fetched" ; \ fi \ - done) -.endif -.endif + done) +.endif # defined(PATCHFILES) +.endif # !target(fetch-list-one-pkg) # Checksumming utilities |