Subject: Package request - better cleaning
To: None <tech-pkg@netbsd.org>
From: Robert Elz <kre@munnari.OZ.AU>
List: tech-pkg
Date: 09/25/1998 04:40:48
I know that there is work being done to the pkg tools at the minute,
I have what I hope is a smallish request ...

When making a pkg, the tools work out what others are required, and build
them.  That's fine.   Required packages are also installed in order to
make the package - even if the one being made is never installed.   It would
be kind of nice if required packages weren't installed unless the dependant
package is also to be installed (and even then perhaps only if run-time
required, rather than just required for compilation), but I suspect that is
quite hard.

However, required packages are also not cleaned if a "make clean" is done,
this one I suspect might be relatively easy to fix.

That is, my standard procedure is
	make && make install && make clean
(and yes, I guess that "make" as well as "make install" is generally
redundant - but it never does any harm, and occasionally is required, at
least for some applications, can't say I've ever tried without the bare "make"
in the NetBSD packages to know if any of them require it).

This all works just perfectly for packages for which no required packages
need to be built, just leaving the distfile, and the installed package,
which is ideal.

But if any required packages were built along the way, those ones don't
get cleaned.

One way to fix that would be to record which other packages are built
as part of building each package (which could itself be useful information
for some purposes - perhaps even as tsort input for correctly ordering the
packages in higher level makefiles for optimal building).   Then make clean
could read that list, and do a make clean in each of the appropriate required
packages.

kre