Eliminate duplicate afterinstallconfigs target

Define separate dependent targets which `afterinstallconfigs` relies on, in
order to modify `${DESTDIR}/etc/master.passwd` and
`${DESTDIR}/etc/nsswitch.conf`.

Mark these targets .PHONY, since they manipulate configurations on the fly and
the generation logic isn't 100% defined in terms of the source files/logic,
and is variable, based on MK_foo flags.

MFC after:	2 weeks
Reviewed by:	bapt, brd
Differential Revision:	https://reviews.freebsd.org/D20330
This commit is contained in:
Enji Cooper 2020-10-01 16:37:49 +00:00
parent d213476d1c
commit c9d175ea90
2 changed files with 4 additions and 2 deletions

View File

@ -552,7 +552,8 @@ MLINKS+=wordexp.3 wordfree.3
.include <src.tools.mk>
afterinstallconfig:
afterinstallconfig: install-passwd
install-passwd: .PHONY
.if ${MK_TCSH} == "no"
sed -i "" -e 's;/bin/csh;/bin/sh;' ${DESTDIR}/etc/master.passwd
.endif

View File

@ -124,8 +124,9 @@ SRCS+= hesiod.c
MAN+= hesiod.3
.endif
afterinstallconfig: modify-nsswitch-conf
modify-nsswitch-conf: .PHONY
.if ${MK_NIS} == "no"
afterinstallconfig:
sed -i "" -e 's/.*_compat:/# &/' -e 's/compat$$/files/' \
${DESTDIR}/etc/nsswitch.conf
.endif