Subject: pkg/28761: make clean CLEANDEPENDS=YES cleans too much...
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <kre@munnari.OZ.AU>
List: pkgsrc-bugs
Date: 12/23/2004 11:51:00
>Number:         28761
>Category:       pkg
>Synopsis:       make clean CLEANDEPENDS=YES cleans too much...
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Dec 23 11:51:00 +0000 2004
>Originator:     Robert Elz
>Release:        NetBSD 1.6X   (pkgsrc -current as of date/time of this message)
>Organization:
	Prince of Songkla University
>Environment:
	Irrelevant information folloes...
System: NetBSD jade.coe.psu.ac.th 1.6X NetBSD 1.6X (JADE) #17: Wed Sep 24 20:25:35 ICT 2003 kre@jade.coe.psu.ac.th:/usr/src/real-sys/arch/i386/compile/JADE i386
Architecture: i386
Machine: i386
>Description:
	Doing:
		make clean CLEANDEPENDS=YES
	after building/installing a package ends up running "make clean"
	(make clean-depends really) in more packages than it probably
	should.   (This is a change request, not a bug report..., so
	what it "probably should" is clearly open for discussion)

	As currently implemented, it cleans every dependency of the
	package (in pkgsrc), regardless of whether or not they were
	actually used while building the package.

	It would probably be more useful (faster, and safer) to only
	clean those packages that actually needed to be built in order
	to build the package that is being cleaned.

>How-To-Repeat:
	Install some package that lots of other things depend on (anything
	that something depends upon is enough, but something important and
	low leven is easier to find - like one of the perl versions, or
	libpng, or something like that).   Install it completely.

	Then go to some other package that uses the one that was just
	installed as a dependency (any of the p5-* packages should do
	is perl was what was selected above).   Do
		make clean CLEANDEPENDS=yes
	(not even necessary to make it to start with) and notice that
	it cleans perl (as well as perhaps lots of other stuff).

	This is most annoying if you happen to have the base package
	in a constructed state while looking for some bug, or doing
	some enhancement to the package, when some other package
	just decides to clean it.

	Cleaning all that was actually dirtied while building a package
	should be enough.

>Fix:
	Lots more code in bas.pkg.mk I assume ... (what fun!)
	Most likely need to keep a record (in WRKDIR I guess)
	of which packages were actually built, that is, which were
	not found to already be installed, and then clean just those.