Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Apr 2002 15:44:54 -0700
From:      Maxime Henrion <mux@freebsd.org>
To:        freebsd-ports@FreeBSD.org
Subject:   patch to have make clean not recurse in ${PORTSDIR}
Message-ID:  <20020424224454.GM88736@elvis.mu.org>

next in thread | raw e-mail | index | archive | help

--sgneBHv3152wZ8jf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

	Hello,


Currently, if you do a ``make clean'' in /usr/ports, it will recurse
through each port's dependencies and clean them too.  This behaviour
causes a lot of ports to be cleaned a lot of times instead of just one.
Moreover, the processing of the dependencies eats a fair amount of CPU
time, which slows things down even more (really).

This can be avoided by doing a ``make NOCLEANDEPENDS=yes clean''
instead.  The purpose of this patch is to make this the default when we
are in ${PORTSDIR} since I don't think the recursing behaviour is of any
use, and even if it was, the scope of this usefulness would probably be
very small.  Currently, there is no way to get back the recursing
behaviour once this patch is applied, but that can be easily changed if
we ever need to.

I won't be surprised at all if I did this patch the wrong way, but I
couldn't think of any other way to pass the NOCLEANDEPENDS=yes. :-)

All comments are welcome.

Thanks,
Maxime

PS: thanks to keep me in the Cc list, since I'm not subscribed to
ports@.

--sgneBHv3152wZ8jf
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="ports.diff"

Index: Makefile
===================================================================
RCS file: /home/ncvs/ports/Makefile,v
retrieving revision 1.65
diff -u -p -r1.65 Makefile
--- Makefile	23 Dec 2001 10:58:42 -0000	1.65
+++ Makefile	24 Apr 2002 22:18:00 -0000
@@ -52,6 +52,8 @@ SUBDIR += x11-servers
 SUBDIR += x11-toolkits
 SUBDIR += x11-wm
 
+SUBDIR_ARGS=	NOCLEANDEPENDS=yes
+
 PORTSTOP=	yes
 
 .include <bsd.port.subdir.mk>
Index: Mk/bsd.port.subdir.mk
===================================================================
RCS file: /home/ncvs/ports/Mk/bsd.port.subdir.mk,v
retrieving revision 1.41
diff -u -p -r1.41 bsd.port.subdir.mk
--- Mk/bsd.port.subdir.mk	23 Dec 2001 11:11:40 -0000	1.41
+++ Mk/bsd.port.subdir.mk	24 Apr 2002 22:17:46 -0000
@@ -21,6 +21,8 @@
 #		Each of the targets will execute the same target in the
 #		subdirectories.
 #
+# SUBDIR_ARGS	Optional arguments to pass in ${MAKE} command line.
+#
 #
 # +++ targets +++
 #
@@ -123,7 +125,7 @@ _SUBDIRUSE: .USE
 	if [ "$$OK" = "" ]; then \
 		${ECHO_MSG} "===> ${DIRPRFX}$${edir}"; \
 		cd ${.CURDIR}/$${edir}; \
-		${MAKE} -B ${.TARGET:E:realinstall=install} \
+		${MAKE} ${SUBDIR_ARGS} -B ${.TARGET:E:realinstall=install} \
 			DIRPRFX=${DIRPRFX}$$edir/; \
 	fi
 

--sgneBHv3152wZ8jf--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-ports" in the body of the message




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