From owner-freebsd-ports Sun Sep 10 16: 1:29 2000 Delivered-To: freebsd-ports@freebsd.org Received: from tisch.mail.mindspring.net (tisch.mail.mindspring.net [207.69.200.157]) by hub.freebsd.org (Postfix) with ESMTP id 5DD6D37B42C; Sun, 10 Sep 2000 16:01:25 -0700 (PDT) Received: from silvia.hip.berkeley.edu (sji-ca5-129.ix.netcom.com [209.109.234.129]) by tisch.mail.mindspring.net (8.9.3/8.8.5) with ESMTP id TAA14057; Sun, 10 Sep 2000 19:00:44 -0400 (EDT) Received: (from asami@localhost) by silvia.hip.berkeley.edu (8.11.0/8.11.0) id e8AN0Fa23267; Sun, 10 Sep 2000 16:00:15 -0700 (PDT) (envelope-from asami) To: Maxim Sobolev Cc: ports@FreeBSD.org Subject: Re: Extending bsd.port.mk diagnostics when some of the patches fail to apply [patch for review] References: <39B377B3.B10E748C@FreeBSD.org> From: asami@FreeBSD.org (Satoshi - Ports Wraith - Asami) Date: 10 Sep 2000 15:59:49 -0700 In-Reply-To: Maxim Sobolev's message of "Mon, 04 Sep 2000 13:21:39 +0300" Message-ID: Lines: 145 X-Mailer: Gnus v5.7/Emacs 20.7 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Final call for review before commit. The patch diagnostics part is identical to sobomax's except some grammatical changes. I also found a couple of places where a "cd ${.CURDIR}" was missing -- this can kill make if /usr/obj${.CURDIR} exists. Finally, a mini-change in the implementation of HTMl X manpages handling. I don't know what I was thinking before, I was probably confused by the MANCOMPRESS stuff where MANL and MANN are special cases since the directories are called "manl" and "mann". Satoshi ------- Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/ports/Mk/bsd.port.mk,v retrieving revision 1.349 diff -u -r1.349 bsd.port.mk --- bsd.port.mk 2000/09/09 13:21:14 1.349 +++ bsd.port.mk 2000/09/09 14:15:16 @@ -1748,6 +1754,7 @@ fi; \ else \ ${ECHO_MSG} "===> Applying ${OPSYS} patches for ${PKGNAME}" ; \ + PATCHES_APPLIED="" ; \ for i in ${PATCHDIR}/patch-*; do \ case $$i in \ *.orig|*.rej|*~) \ @@ -1756,8 +1763,16 @@ *) \ if [ ${PATCH_DEBUG_TMP} = yes ]; then \ ${ECHO_MSG} "===> Applying ${OPSYS} patch $$i" ; \ + fi; \ + if ${PATCH} ${PATCH_ARGS} < $$i ; then \ + PATCHES_APPLIED="$$PATCHES_APPLIED $$i" ; \ + else \ + ${ECHO_MSG} `${ECHO} ">> Patch $$i failed to apply cleanly." | ${SED} "s|${PATCHDIR}/||"` ; \ + if [ x"$$PATCHES_APPLIED" != x"" ]; then \ + ${ECHO_MSG} `${ECHO} ">> Patch(es) $$PATCHES_APPLIED applied cleanly." | ${SED} "s|${PATCHDIR}/||g"` ; \ + fi; \ + ${FALSE} ; \ fi; \ - ${PATCH} ${PATCH_ARGS} < $$i; \ ;; \ esac; \ done; \ @@ -1855,7 +1870,7 @@ .if !target(package-links) package-links: - @${MAKE} ${__softMAKEFLAGS} delete-package-links + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} delete-package-links @for cat in ${CATEGORIES}; do \ if [ ! -d ${PACKAGES}/$$cat ]; then \ if ! ${MKDIR} ${PACKAGES}/$$cat; then \ @@ -1888,7 +1903,7 @@ .if !target(delete-package) delete-package: - @${MAKE} ${__softMAKEFLAGS} delete-package-links + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} delete-package-links @${RM} -f ${PKGFILE} .endif @@ -1904,7 +1919,7 @@ .if !target(delete-package-list) delete-package-list: - @${MAKE} ${__softMAKEFLAGS} delete-package-links-list + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} delete-package-links-list @${ECHO} "[ -f ${PKGFILE} ] && (${ECHO} deleting ${PKGFILE}; ${RM} -f ${PKGFILE})" .endif @@ -2180,7 +2195,7 @@ .if !target(reinstall) reinstall: @${RM} -f ${INSTALL_COOKIE} ${PACKAGE_COOKIE} - @DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} install + @cd ${.CURDIR} && DEPENDS_TARGET="${DEPENDS_TARGET}" ${MAKE} install .endif # Deinstall @@ -2218,15 +2233,15 @@ .if !target(clean) clean: .if !defined(NOCLEANDEPENDS) - @${MAKE} ${__softMAKEFLAGS} clean-depends + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} clean-depends .endif @${ECHO_MSG} "===> Cleaning for ${PKGNAME}" .if target(pre-clean) - @${MAKE} ${__softMAKEFLAGS} pre-clean + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pre-clean .endif - @${MAKE} ${__softMAKEFLAGS} do-clean + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} do-clean .if target(post-clean) - @${MAKE} ${__softMAKEFLAGS} post-clean + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} post-clean .endif .endif @@ -2781,19 +2796,19 @@ .if !target(readme) readme: - @rm -f README.html - @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} README.html + @rm -f ${.CURDIR}/README.html + @cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} ${.CURDIR}/README.html .endif -README.html: +${.CURDIR}/README.html: @${ECHO_MSG} "===> Creating README.html for ${PKGNAME}" @${CAT} ${TEMPLATES}/README.port | \ ${SED} -e 's%%PORT%%'`${ECHO} ${.CURDIR} | ${SED} -e 's.*/\([^/]*/[^/]*\)$$\1'`'g' \ -e 's%%PKG%%${PKGNAME}g' \ -e '/%%COMMENT%%/r${PKGDIR}/COMMENT' \ -e '/%%COMMENT%%/d' \ - -e 's%%BUILD_DEPENDS%%'"`${MAKE} ${__softMAKEFLAGS} pretty-print-build-depends-list`"'' \ - -e 's%%RUN_DEPENDS%%'"`${MAKE} ${__softMAKEFLAGS} pretty-print-run-depends-list`"'' \ + -e 's%%BUILD_DEPENDS%%'"`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pretty-print-build-depends-list`"'' \ + -e 's%%RUN_DEPENDS%%'"`cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} pretty-print-run-depends-list`"'' \ -e 's%%TOP%%'"`${ECHO} ${CATEGORIES} | ${SED} -e 'sa .*aa' -e 'sa[^/]*a..ag'`"'/..' \ >> $@ @@ -2844,8 +2859,8 @@ @${ECHO} '@cwd ${PREFIX}' >> ${TMPPLIST} .endif .if ${XFREE86_HTML_MAN} == "yes" -.for mansect in MAN1 MAN2 MAN3 MAN4 MAN5 MAN6 MAN7 MAN8 MAN9 MANL MANN -.for man in ${${mansect}} +.for mansect in 1 2 3 4 5 6 7 8 9 L N +.for man in ${MAN${mansect}} @echo lib/X11/doc/html/${man}.html >> ${TMPPLIST} .endfor .endfor @@ -2929,7 +2944,7 @@ if [ -f ${PKGMESSAGE} ]; then \ ${CP} ${PKGMESSAGE} ${PKG_DBDIR}/${PKGNAME}/+DISPLAY; \ fi; \ - for dep in `${MAKE} ${__softMAKEFLAGS} package-depends ECHO_MSG=/usr/bin/true | sort -u`; do \ + for dep in `cd ${.CURDIR} && ${MAKE} ${__softMAKEFLAGS} package-depends ECHO_MSG=/usr/bin/true | sort -u`; do \ if [ -d ${PKG_DBDIR}/$$dep -a -z `echo $$dep | ${GREP} -E ${PKG_IGNORE_DEPENDS}` ]; then \ if ! ${GREP} ^${PKGNAME}$$ ${PKG_DBDIR}/$$dep/+REQUIRED_BY \ >/dev/null 2>&1; then \ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message