prune ports tree?

Polytropon freebsd at
Sat Jun 9 06:21:37 UTC 2012

On Sat, 09 Jun 2012 00:06:39 -0600, Gary Aitken wrote:
> Is it possible to specify that parts of the ports tree should never be used?

How do you want to understand by "parts" and "not used"?

The easiest way to "not use" some part of the ports tree is to
remove that part. You can do that by manually deleting the port(s)
and even omitting them when updating your ports tree.

If you use csup, you can make /etc/sup/ports.sup like this:
Don't use ports-all, but only list the categories you want to
have updated. This works category-wise. You'll find examples
in /usr/share/examples/cvsup/ports-supfile which you can use
as a template for your own configuration file.

An example of /etc/sup/ports.sup could look like this:

	*default base=/var/db
	*default prefix=/usr
	*default release=cvs tag=.
	*default delete use-rel-suffix
	*default compress
		[ ... list shortened ... ]

Only the listed ports categories will be updated.

Then you can add this to /etc/make.conf:

	SUP=		/usr/bin/csup		<---
	SUP_UPDATE=	/usr/bin/csup		<---
	SUPFLAGS=	-L 2			<---
	SUPFILE=	/etc/sup/stable.sup
	PORTSSUPFILE=	/etc/sup/ports.sup	<---
	DOCSUPFILE=	/etc/sup/doc.sup
	DOC_LANG=	en_US.ISO8859-1 de_DE.ISO8859-1

The important lines are marked with a <---. Now you can do

	# cd /usr/ports
	# make update

and you'll get the latest ports tree _excluding_ what you have
already removed.

You can also use /usr/ports/.cvsignore to specify the directories
csup should ignore; defaults are "distfiles" and "packages".
You can list "offending" ports here.

This approach does _not_ work well when using portsnap. From
the portsnap.conf manpage: "Note that operating with an incomplete
ports tree is not supported and may cause unexpected results."

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list