zoneinfo: fix makefile rules script

In make target rules, one needs to use subshell if there are
change directory commands that should only have an effect on the
other commands in the same line. Otherwise, if make is not running in
compatibility mode (for example, when -j flag is specified), commands
would be executed in a single shell and lines following the "cd" might
not work as expected.

Adjust the target script lines that use "cd" to run in a subshell
by adding appropriate parenthesis.

Reviewed by:	sjg
Differential Revision:        https://reviews.freebsd.org/D42608
This commit is contained in:
Stephen J. Kiernan 2023-11-14 19:38:47 -05:00
parent 8ef8939fd4
commit fa08011a52

View file

@ -93,10 +93,10 @@ ZIC= ${STAGE_HOST_OBJTOP}/usr/sbin/zic
zoneinfo: ${TDATA}
mkdir -p ${TZBUILDDIR}
cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS}
umask 022; cd ${.CURDIR}; \
(cd ${TZBUILDDIR}; mkdir -p ${TZBUILDSUBDIRS})
(umask 022; cd ${.CURDIR}; \
${ZIC:Uzic} -D -d ${TZBUILDDIR} ${ZICFLAGS} -m ${NOBINMODE} \
${LEAPFILE} ${TZFILES}
${LEAPFILE} ${TZFILES})
#
# Sort TZS to ensure they are the same every build. find -s might
@ -110,7 +110,7 @@ TZS!= cd ${TZBUILDDIR} && find * -type f | LC_ALL=C sort
beforeinstall: install-zoneinfo
install-zoneinfo:
mkdir -p ${DESTDIR}/usr/share/zoneinfo
cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS}
(cd ${DESTDIR}/usr/share/zoneinfo; mkdir -p ${TZBUILDSUBDIRS})
.for f in ${TZS}
${INSTALL} ${TAG_ARGS} \
-o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \