Skip to content

Commit 47aa9c1

Browse files
authored
Rename ENV to _ENV (#169)
`ENV` is a reserved variable for `/bin/sh` which is used to setup interactive shells. Rename the variable to `_ENV` to avoid the collision with `/bin/sh`'s reserved variable name. Fixes: da1e0f6 ("Unbreak the build when `ARCH` is not explicitly specified") Reported by: @joelpelaez Signed-off-by: Enji Cooper <ngie@FreeBSD.org>
1 parent da1e0f6 commit 47aa9c1

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

Makefile

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ SYSCTL?= /sbin/sysctl
6060
PKG?= /usr/local/sbin/pkg
6161
OPENSSL?= /usr/bin/openssl
6262
CUT?= /usr/bin/cut
63-
ENV?= /usr/bin/env
63+
# NOTE: `ENV` is used by /bin/sh for setting up `.profile` in interactive
64+
# shells, so this can't be named `ENV`.
65+
_ENV?= /usr/bin/env
6466
GREP?= /usr/bin/grep
6567
XARGS?= /usr/bin/xargs
6668
#
@@ -188,7 +190,7 @@ _DESTDIR= ${_ROOTDIR}
188190

189191
.if !defined(SE)
190192
# Environment for custom build
191-
BUILDENV?= ${ENV} \
193+
BUILDENV?= ${_ENV} \
192194
NO_FSCHG=1 \
193195
WITHOUT_CLANG=1 \
194196
WITHOUT_DICT=1 \
@@ -205,7 +207,7 @@ BUILDENV+= \
205207
TARGET_ARCH=${TARGET_ARCH}
206208

207209
# Environment for custom scripts
208-
CUSTOMSCRIPTENV?= ${ENV} \
210+
CUSTOMSCRIPTENV?= ${_ENV} \
209211
WRKDIR=${WRKDIR} \
210212
DESTDIR=${_DESTDIR} \
211213
DISTDIR=${_DISTDIR} \
@@ -377,7 +379,7 @@ ${WRKDIR}/.packages_done:
377379
fi; \
378380
if [ -n "$${_PKGS}" ]; then \
379381
${GREP} -v "^#" $${_PKGS} | \
380-
${ENV} ASSUME_ALWAYS_YES=yes \
382+
${_ENV} ASSUME_ALWAYS_YES=yes \
381383
PKG_ABI="${PKG_ABI}" \
382384
PKG_CACHEDIR=${WRKDIR}/pkgcache \
383385
${XARGS} ${PKG} -r ${_DESTDIR} install; \
@@ -393,7 +395,7 @@ ${WRKDIR}/.packages_mini_done:
393395
_PKGS="${TOOLSDIR}/packages-mini.sample"; \
394396
fi; \
395397
if [ -n "$${_PKGS}" ]; then \
396-
${ENV} ASSUME_ALWAYS_YES=yes \
398+
${_ENV} ASSUME_ALWAYS_YES=yes \
397399
PKG_ABI="${PKG_ABI}" \
398400
PKG_CACHEDIR=${WRKDIR}/pkgcache \
399401
${PKG} -r ${_DESTDIR} install `${CAT} $${_PKGS}`; \
@@ -530,7 +532,7 @@ roothack: ${WRKDIR}/roothack/roothack
530532
${WRKDIR}/roothack/roothack:
531533
.if !defined(ROOTHACK_PREBUILT)
532534
${_v}${MKDIR} -p ${WRKDIR}/roothack
533-
${_v}cd ${TOOLSDIR}/roothack && ${ENV} MAKEOBJDIR=${WRKDIR}/roothack make
535+
${_v}cd ${TOOLSDIR}/roothack && ${_ENV} MAKEOBJDIR=${WRKDIR}/roothack make
534536
.endif
535537

536538
install-roothack: compress-usr roothack ${WRKDIR}/.install-roothack_done

0 commit comments

Comments
 (0)