kern.post.mk: fix PORTSDIR handling

Using subshell's PORTSDIR variable (via $${PORTSDIR}}) seems to be
only working if PORTSDIR is specified directly on the make command
line.

Use ${PORTDIR} here instead so that setting the variable in
/etc/{make,src,src-env}.conf would work (also works for variable
being set on command line or in the environment).

PR:		268299
Reviewed by:	imp
Differential Revision:	https://reviews.freebsd.org/D37868
This commit is contained in:
Yuri Pankov 2023-03-27 13:42:31 +02:00 committed by Oscar Zhao
parent bd0ba500b9
commit a3d166347b

View File

@ -133,7 +133,7 @@ PORTSMODULESENV=\
all:
.for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (all)"
cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean build
cd ${PORTSDIR:U/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B clean build
.endfor
.for __target in install reinstall clean
@ -141,7 +141,7 @@ ${__target}: ports-${__target}
ports-${__target}:
.for __i in ${PORTS_MODULES}
@${ECHO} "===> Ports module ${__i} (${__target})"
cd $${PORTSDIR:-/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/(re)?install/deinstall reinstall/}
cd ${PORTSDIR:U/usr/ports}/${__i}; ${PORTSMODULESENV} ${MAKE} -B ${__target:C/(re)?install/deinstall reinstall/}
.endfor
.endfor
.endif