Created attachment 186423 [details] patch file Writing ports-specific settings to /etc/make.conf is not good because such settings are also applied when you 'make' something that has nothing to with ports. There is a workaround to guard them as following: .if !empty(.CURDIR:M*usr/ports*) # settings that should be applied only for ports build. .endif But there is some cases that such a workaround does not work as expected. For example, 1. When /usr/ports is symbolic link to somewhere else and real path is somothing like /foo/bar/baz/portsdir. 2. When you decide to do some experiment, check out port tree to /some/where/temp/ports, cd to /some/where/temp/ports/category/portname, edit some files and try 'make PORTSDIR=/some/where/temp/ports'. By contrast including file for ports-specific settings from bsd.port.mk works well regardless of whether /usr/ports is symbolic link or not, whatever the real path of /usr/ports is and whatever value is set as PORTSDIR. And in addtion there is already similar best practice in base system, /etc/src.conf. So I think this is better way to isolate ports-specific settings from others.
Those customizations should go into /usr/local/etc/poudriere.d/JAILNAME-make.conf. You could match on */ports/*, or make /usr/ports/Makefile.local, etc. Including yet another file feels redundant, and people are going to want to be able to redefine that location so that it can be in VC. Ports are designed to be configured by 'make config.' If you want to do it by hand, they're much better off in poudriere.d/JAILNAME-make.conf, or poudriere.d/make.conf to apply everywhere.
(In reply to Adam Weinberger from comment #1) What I would like to put in /etc/ports.conf is 1. Settings that affects all ports (DEVELOPER,DISTDIR,PACKAGES,WRKDIRPREFIX etc.) 2. Settings that affects multipule ports (DEFAULT_VERSION for example) And ways you provide do not satisfy my requirement because 1. /usr/local/etc/poudriere.d/JAILNAME-make.conf works only with poudriere. If you use other tools (portupgrade, portmaster, synth etc.) or don't use any tools and just do 'cd /usr/ports/cat/name; make install', it has no effect. 2. Matching pattern '*/ports/*' does not work if real path does not include 'ports'. Ports tree can check out anywhere in the file system and it is impossible to specify pattern to match such ports tree. 3. As for /usr/ports/Makefile.local, I moved my /etc/ports.conf to /usr/ports/Makefile.local and tried to build some ports. But it seemed no effect. Is it really work as a way to customize global behavior of ports framework ? What I would like to achieve is to provide way to customize ports framework with following 2 conditions. 1. Settings does not affect outside of ports framework. 2. Customization works regardless of - What tools are used or no tool is used at all. - Where the real path of port tree is.
Give up this bug report.