Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Aug 1996 00:38:35 -0700 (PDT)
From:      asami@cs.berkeley.edu (Satoshi Asami)
To:        obrien@Nuxi.cs.ucdavis.edu
Cc:        jmacd@cs.berkeley.edu, jkh@time.cdrom.com, karl@Mcs.Net, freebsd-ports@FreeBSD.org
Subject:   Re: Ports explosion
Message-ID:  <199608150738.AAA17605@silvia.HIP.Berkeley.EDU>
In-Reply-To: <199608130729.AAA21578@relay.nuxi.com> (obrien@Nuxi.cs.ucdavis.edu)

next in thread | previous in thread | raw e-mail | index | archive | help
 * 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199608150738.AAA17605>