From edwin@mavetju.org  Sun Oct  7 19:04:01 2001
Return-Path: <edwin@mavetju.org>
Received: from topaz.mdcc.cx (topaz.mdcc.cx [212.204.230.141])
	by hub.freebsd.org (Postfix) with ESMTP id A786437B405
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  7 Oct 2001 19:04:00 -0700 (PDT)
Received: from k7.mavetju.org (topaz.mdcc.cx [212.204.230.141])
	by topaz.mdcc.cx (Postfix) with ESMTP id D10B32B71A
	for <FreeBSD-gnats-submit@freebsd.org>; Mon,  8 Oct 2001 04:03:52 +0200 (CEST)
Received: by k7.mavetju.org (Postfix, from userid 1001)
	id F07F12AA; Mon,  8 Oct 2001 12:03:47 +1000 (EST)
Message-Id: <20011008020347.F07F12AA@k7.mavetju.org>
Date: Mon,  8 Oct 2001 12:03:47 +1000 (EST)
From: Edwin Groothuis <edwin@mavetju.org>
Reply-To: Edwin Groothuis <edwin@mavetju.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: bsd.ports.subdir.mk: remove NOCLEANDEPENDS from the /etc/make.conf
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         31113
>Category:       ports
>Synopsis:       bsd.ports.subdir.mk: remove NOCLEANDEPENDS from the /etc/make.conf
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    portmgr
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Oct 07 19:10:01 PDT 2001
>Closed-Date:    Fri Aug 30 22:14:29 PDT 2002
>Last-Modified:  Fri Aug 30 22:14:29 PDT 2002
>Originator:     Edwin Groothuis
>Release:        FreeBSD 4.4-RELEASE i386
>Organization:
-
>Environment:
System: FreeBSD k7.mavetju.org 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Thu Oct 4 08:49:05 EST 2001 edwin@k7.mavetju.org:/usr/src/sys/compile/k7 i386

>Description:

When using "make clean" in a directory below /usr/ports/*, default
is to do a make clean for the dependant ports also. This is nice.

When using "make clean" in /usr/ports or in a directory of
/usr/ports/*, default is to do a make clean for the dependant ports
also. This is not nice, because a lot of ports have the same
dependencies, causing a *lot* of extra calls for "make clean"s which
are not needed.

The solution for this is to add NOCLEANDEPENDS=yes in /etc/make.conf.
But then next time when you run "make clean" in a freshly cleaned
ports-directory, it will not clean the dependencies (which is
exactly what is wanted with putting it in /etc/make.conf).

There is a problem here with the fact that /etc/make.conf is used
for both the ports-directory makefile and the port-makefile.

>How-To-Repeat:

run "make clean" in /usr/ports
>Fix:

The solution for this "make clean" problem, possible together with
other problems, is to be able to pass a variable from the
bsd.ports.subdir.mk to the new port:

--- bsd.port.subdir.mk.orig	Mon Oct  8 11:29:20 2001
+++ bsd.port.subdir.mk	Mon Oct  8 11:42:30 2001
@@ -21,6 +21,12 @@
 #		Each of the targets will execute the same target in the
 #		subdirectories.
 #
+# PORTARGS	A variable for local arguments which are passed to the
+#		targets one directory below this. This is to be
+#		used when you have a variable in /etc/make.conf
+#		which is only used in the directories with the
+#              ports, not in the subdirectories above it. For
+#		example NOCLEANDEPENDS.
 #
 # +++ targets +++
 #
@@ -94,6 +100,10 @@
 TARGETS+=	reinstall
 TARGETS+=	tags
 
+.if make(clean)
+PORTARGS+=	NOCLEANDEPENDS=yes
+.endif
+
 .for __target in ${TARGETS}
 .if !target(${__target})
 ${__target}: ${SUBDIR:S/$/.${__target}/}
@@ -123,7 +133,7 @@
 	if [ "$$OK" = "" ]; then \
 		${ECHO_MSG} "===> ${DIRPRFX}$${edir}"; \
 		cd ${.CURDIR}/$${edir}; \
-		${MAKE} -B ${.TARGET:E:realinstall=install} \
+		${MAKE} -B ${PORTARGS} ${.TARGET:E:realinstall=install} \
 			DIRPRFX=${DIRPRFX}$$edir/; \
 	fi
 

This patch will introduce the possibility to add environment
variables from the ports-directories-makefile towards the
ports-makefile.
>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: Edwin Groothuis <edwin@mavetju.org>
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: ports/31113: bsd.ports.subdir.mk: remove NOCLEANDEPENDS from the /etc/make.conf
Date: Tue, 9 Oct 2001 14:30:01 +0300

 On Mon, Oct 08, 2001 at 12:03:47PM +1000, Edwin Groothuis wrote:
 > 
 > >Number:         31113
 > >Category:       ports
 > >Synopsis:       bsd.ports.subdir.mk: remove NOCLEANDEPENDS from the /etc/make.conf
 > >Originator:     Edwin Groothuis
 > >Release:        FreeBSD 4.4-RELEASE i386
 > >Organization:
 > -
 > >Environment:
 > System: FreeBSD k7.mavetju.org 4.4-RELEASE FreeBSD 4.4-RELEASE #0: Thu Oct 4 08:49:05 EST 2001 edwin@k7.mavetju.org:/usr/src/sys/compile/k7 i386
 > 
 > >Description:
 > 
 > When using "make clean" in a directory below /usr/ports/*, default
 > is to do a make clean for the dependant ports also. This is nice.
 > 
 > When using "make clean" in /usr/ports or in a directory of
 > /usr/ports/*, default is to do a make clean for the dependant ports
 > also. This is not nice, because a lot of ports have the same
 > dependencies, causing a *lot* of extra calls for "make clean"s which
 > are not needed.
 > 
 > The solution for this is to add NOCLEANDEPENDS=yes in /etc/make.conf.
 > But then next time when you run "make clean" in a freshly cleaned
 > ports-directory, it will not clean the dependencies (which is
 > exactly what is wanted with putting it in /etc/make.conf).
 
 Uhm.. wouldn't a simpler solution be to specify NOCLEANDEPENDS for
 just that one run of make(1), on the command line?
 Something like 'make NOCLEANDEPENDS=yes clean' or simply
 'make -DNOCLEANDEPENDS clean'?
 
 G'luck,
 Peter
 
 -- 
 If the meanings of 'true' and 'false' were switched, then this sentence wouldn't be false.
Responsible-Changed-From-To: freebsd-ports->portmgr 
Responsible-Changed-By: ijliao 
Responsible-Changed-When: Fri Oct 12 02:51:37 PDT 2001 
Responsible-Changed-Why:  
over to maintainer 

http://www.FreeBSD.org/cgi/query-pr.cgi?pr=31113 
State-Changed-From-To: open->closed 
State-Changed-By: kris 
State-Changed-When: Fri Aug 30 22:12:25 PDT 2002 
State-Changed-Why:  
I don't think this is a problem requiring bsd.port.mk 
changes; just specify -DNOCLEANDEPENDS on the command-line 
if/when you want to do this. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=31113 
>Unformatted:
