diff options
author | mycroft <mycroft@pkgsrc.org> | 2000-06-03 21:51:57 +0000 |
---|---|---|
committer | mycroft <mycroft@pkgsrc.org> | 2000-06-03 21:51:57 +0000 |
commit | 2e07bae1593a4ceaba7a6793b3f4cf9c9404a440 (patch) | |
tree | b9333559f4e5de9dd37db1fec8e52fef58fdd9b1 /mk/bsd.pkg.mk | |
parent | e199f937e4783841e13b6175842446cdcf5d1226 (diff) | |
download | pkgsrc-2e07bae1593a4ceaba7a6793b3f4cf9c9404a440.tar.gz |
* Fix a bug in clean-depends: the `sort -u' was ineffective because the `tr'
was missing.
* Do make(1) pattern substitutions for fetch-list-recursive.
* Eliminate subshells in clean-depends and fetch-list-recursive.
* Make the rmdir for the WRKOBJDIR removal silent if it fails.
* Slight optimization to fetch-list-one-pkg: don't do the basename operation
twice.
Diffstat (limited to 'mk/bsd.pkg.mk')
-rw-r--r-- | mk/bsd.pkg.mk | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/mk/bsd.pkg.mk b/mk/bsd.pkg.mk index 374c06427cf..c7e47bb9416 100644 --- a/mk/bsd.pkg.mk +++ b/mk/bsd.pkg.mk @@ -1,4 +1,4 @@ -# $NetBSD: bsd.pkg.mk,v 1.468 2000/06/03 20:58:46 tron Exp $ +# $NetBSD: bsd.pkg.mk,v 1.469 2000/06/03 21:51:57 mycroft Exp $ # # This file is in the public domain. # @@ -1970,7 +1970,7 @@ clean: pre-clean fi .ifdef WRKOBJDIR -${_PKG_SILENT}${_PKG_DEBUG} \ - ${RMDIR} ${BUILD_DIR}; \ + ${RMDIR} ${BUILD_DIR} 2>/dev/null; \ ${RM} -f ${WRKDIR_BASENAME} .endif .else @@ -1984,13 +1984,13 @@ clean: pre-clean .if !target(clean-depends) clean-depends: .if defined(BUILD_DEPENDS) || defined(DEPENDS) || defined(RUN_DEPENDS) - ${_PKG_SILENT}${_PKG_DEBUG}\ - for dir in `${ECHO} ${BUILD_DEPENDS:C/^[^:]*://:C/:.*//} \ - ${DEPENDS:C/^[^:]*://:C/:.*//} \ - ${RUN_DEPENDS:C/^[^:]*://:C/:.*//} | sort -u`; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && ${MAKE} ${MAKEFLAGS} CLEANDEPENDS=${CLEANDEPENDS} clean ); \ - fi \ + ${_PKG_SILENT}${_PKG_DEBUG} \ + for dir in `${ECHO} ${BUILD_DEPENDS:C/^[^:]*://:C/:.*//} \ + ${DEPENDS:C/^[^:]*://:C/:.*//} \ + ${RUN_DEPENDS:C/^[^:]*://:C/:.*//} | \ + ${TR} '\040' '\012' | sort -u`; do \ + cd ${.CURDIR}/$$dir && \ + ${MAKE} ${MAKEFLAGS} CLEANDEPENDS=${CLEANDEPENDS} clean;\ done .endif .endif @@ -2039,8 +2039,13 @@ fetch-list: fetch-list-recursive: @${MAKE} ${MAKEFLAGS} fetch-list-one-pkg .if ${RECURSIVE_FETCH_LIST} != "NO" - @for dir in `${ECHO} "${BUILD_DEPENDS} ${DEPENDS} ${RUN_DEPENDS}" | ${TR} '\040' '\012' | ${SED} -e 's/^[^:]*://' -e 's/:.*//' | sort -u` ; do \ - (cd $$dir && ${MAKE} ${MAKEFLAGS} fetch-list-recursive; ); \ + ${_PKG_SILENT}${_PKG_DEBUG} \ + for dir in `${ECHO} ${BUILD_DEPENDS:C/^[^:]*://:C/:.*//} \ + ${DEPENDS:C/^[^:]*://:C/:.*//} \ + ${RUN_DEPENDS:C/^[^:]*://:C/:.*//} | \ + ${TR} '\040' '\012' | sort -u` ; do \ + cd ${.CURDIR}/$$dir && \ + ${MAKE} ${MAKEFLAGS} fetch-list-recursive; \ done .endif # ${RECURSIVE_FETCH_LIST} != "NO" .endif # !target(fetch-list-recursive) @@ -2053,11 +2058,12 @@ fetch-list-one-pkg: @(cd ${_DISTDIR}; \ for file in "" ${DISTFILES}; do \ if [ "X$$file" = X"" ]; then continue; fi; \ - if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ - ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \ + bfile=`${BASENAME} $$file`; \ + if [ ! -f $$file -a ! -f $$bfile ]; then \ + ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f $$bfile ] || "; \ for site in "" `${SORTED_MASTER_SITES_CMD}`; do \ if [ "X$$site" = X"" ]; then continue; fi; \ - ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \ + ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| '; \ done; \ ${ECHO} "${ECHO} $${file} not fetched"; \ fi \ @@ -2067,10 +2073,11 @@ fetch-list-one-pkg: @(cd ${_DISTDIR}; \ for file in "" ${PATCHFILES}; do \ if [ "X$$file" = X"" ]; then continue; fi; \ - if [ ! -f $$file -a ! -f `${BASENAME} $$file` ]; then \ - ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f `${BASENAME} $$file` ] || " ; \ + bfile=`${BASENAME} $$file`; \ + if [ ! -f $$file -a ! -f $$bfile ]; then \ + ${ECHO} -n "cd ${_DISTDIR} && [ -f $$file -o -f $$bfile ] || "; \ for site in ${PATCH_SITES}; do \ - ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| ' ; \ + ${ECHO} -n ${FETCH_CMD} ${FETCH_BEFORE_ARGS} $${site}$${file} "${FETCH_AFTER_ARGS}" '|| '; \ done; \ ${ECHO} "${ECHO} $${file} not fetched"; \ fi \ |