From owner-freebsd-ports Thu Aug 15 00:38:47 1996 Return-Path: owner-ports Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id AAA18537 for ports-outgoing; Thu, 15 Aug 1996 00:38:47 -0700 (PDT) Received: from silvia.HIP.Berkeley.EDU (silvia.HIP.Berkeley.EDU [136.152.64.181]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id AAA18527 for ; Thu, 15 Aug 1996 00:38:43 -0700 (PDT) Received: (from asami@localhost) by silvia.HIP.Berkeley.EDU (8.7.5/8.6.9) id AAA17605; Thu, 15 Aug 1996 00:38:35 -0700 (PDT) Date: Thu, 15 Aug 1996 00:38:35 -0700 (PDT) Message-Id: <199608150738.AAA17605@silvia.HIP.Berkeley.EDU> To: obrien@Nuxi.cs.ucdavis.edu CC: jmacd@cs.berkeley.edu, jkh@time.cdrom.com, karl@Mcs.Net, freebsd-ports@FreeBSD.org In-reply-to: <199608130729.AAA21578@relay.nuxi.com> (obrien@Nuxi.cs.ucdavis.edu) Subject: Re: Ports explosion From: asami@cs.berkeley.edu (Satoshi Asami) Sender: owner-ports@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk * This could be quite useful. I've heard of simular problems like this * before on the list/newsgroup. However, it does promote sloppiness... * since there would be little modivation to remove empty directories. Ok, here's a patch (no pun intended). While I was in there, I cleaned up the PATCH_DEBUG code too, so we don't duplicate too much code just to add a single echo statement. The diff looks large because I deleted a lot of code from this cleanup and one level of indentation was added to another big chunk, please apply this to your tree and do a "diff -ub" if you want to know what really changed. Now it will ignore the patches/ directory unless there are file with names "patch-*" in it. It even prints out a suggestion if there is a directory "CVS" in it with no patch file! :) Satoshi ------- P.S. Actually, this fails if there is a file called patch-* (with a real asterisk) which worked before, but I don't think we need to further complicate bsd.port.mk by covering that case (can you spell "pathological"? :).... Index: bsd.port.mk =================================================================== RCS file: /usr/cvs/src/share/mk/bsd.port.mk,v retrieving revision 1.219 diff -u -r1.219 bsd.port.mk --- bsd.port.mk 1996/08/15 05:55:33 1.219 +++ bsd.port.mk 1996/08/15 07:24:43 @@ -177,6 +177,8 @@ # IS_DEPENDED_TARGET=fetch" will fetch all the distfiles, # including those of dependencies, without actually building # any of them). +# PATCH_DEBUG - If set, print out more information about the patches as +# it attempts to apply them. # # Variables that serve as convenient "aliases" for your *-install targets: # @@ -296,9 +298,11 @@ PATCH_STRIP?= -p0 PATCH_DIST_STRIP?= -p0 .if defined(PATCH_DEBUG) +PATCH_DEBUG_TMP= yes PATCH_ARGS?= -d ${WRKSRC} -E ${PATCH_STRIP} PATCH_DIST_ARGS?= -d ${WRKSRC} -E ${PATCH_DIST_STRIP} .else +PATCH_DEBUG_TMP= no PATCH_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_STRIP} PATCH_DIST_ARGS?= -d ${WRKSRC} --forward --quiet -E ${PATCH_DIST_STRIP} .endif @@ -647,22 +651,11 @@ do-patch: .if defined(PATCHFILES) @${ECHO_MSG} "===> Applying distribution patches for ${PKGNAME}" -.if defined(PATCH_DEBUG) - @(cd ${DISTDIR}; \ - for i in ${PATCHFILES}; do \ - ${ECHO_MSG} "===> Applying distribution patch $$i" ; \ - case $$i in \ - *.Z|*.gz) \ - ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \ - ;; \ - *) \ - ${PATCH} ${PATCH_DIST_ARGS} < $$i; \ - ;; \ - esac; \ - done) -.else @(cd ${DISTDIR}; \ for i in ${PATCHFILES}; do \ + if [ ${PATCH_DEBUG_TMP} = yes ]; then \ + ${ECHO_MSG} "===> Applying distribution patch $$i" ; \ + fi; \ case $$i in \ *.Z|*.gz) \ ${GZCAT} $$i | ${PATCH} ${PATCH_DIST_ARGS}; \ @@ -673,37 +666,29 @@ esac; \ done) .endif -.endif -.if defined(PATCH_DEBUG) @if [ -d ${PATCHDIR} ]; then \ - ${ECHO_MSG} "===> Applying FreeBSD patches for ${PKGNAME}" ; \ - for i in ${PATCHDIR}/patch-*; do \ - case $$i in \ - *.orig|*~) \ - ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \ - ;; \ - *) \ - ${ECHO_MSG} "===> Applying FreeBSD patch $$i" ; \ - ${PATCH} ${PATCH_ARGS} < $$i; \ - ;; \ - esac; \ - done; \ - fi -.else - @if [ -d ${PATCHDIR} ]; then \ - ${ECHO_MSG} "===> Applying FreeBSD patches for ${PKGNAME}" ; \ - for i in ${PATCHDIR}/patch-*; do \ - case $$i in \ - *.orig|*~) \ - ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \ - ;; \ - *) \ - ${PATCH} ${PATCH_ARGS} < $$i; \ - ;; \ - esac; \ - done;\ + if [ "`echo ${PATCHDIR}/patch-*`" = "${PATCHDIR}/patch-*" ]; then \ + ${ECHO_MSG} "===> Ignoring empty patch directory"; \ + if [ -d ${PATCHDIR}/CVS ]; then \ + ${ECHO_MSG} "===> Perhaps you forgot the -P flag to cvs co or update?"; \ + fi; \ + else \ + ${ECHO_MSG} "===> Applying FreeBSD patches for ${PKGNAME}" ; \ + for i in ${PATCHDIR}/patch-*; do \ + case $$i in \ + *.orig|*~) \ + ${ECHO_MSG} "===> Ignoring patchfile $$i" ; \ + ;; \ + *) \ + if [ ${PATCH_DEBUG_TMP} = yes ]; then \ + ${ECHO_MSG} "===> Applying FreeBSD patch $$i" ; \ + fi; \ + ${PATCH} ${PATCH_ARGS} < $$i; \ + ;; \ + esac; \ + done; \ + fi; \ fi -.endif .endif # Configure