From fa08011a521c1f15ca44d6a4f30a318d0a37a3a7 Mon Sep 17 00:00:00 2001 From: "Stephen J. Kiernan" Date: Tue, 14 Nov 2023 19:38:47 -0500 Subject: [PATCH] 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 --- share/zoneinfo/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/share/zoneinfo/Makefile b/share/zoneinfo/Makefile index f2f14c01c7be..60ae1f76f5b5 100644 --- a/share/zoneinfo/Makefile +++ b/share/zoneinfo/Makefile @@ -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} \