diff --git a/Meta/lint-ports.py b/Meta/lint-ports.py index 2d852bf46c6..e24160ef35d 100755 --- a/Meta/lint-ports.py +++ b/Meta/lint-ports.py @@ -21,6 +21,7 @@ PORT_TABLE_FILE = 'AvailablePorts.md' IGNORE_FILES = { '.gitignore', '.port_include.sh', + '.strip_env.sh', PORT_TABLE_FILE, 'build_all.sh', 'build_installed.sh', diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index 31bec3dc2dd..78c6d89d3b1 100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -2,6 +2,12 @@ set -eu SCRIPT="$(dirname "${0}")" + +if [ -z "${SERENITY_STRIPPED_ENV:-}" ]; then + exec "${SCRIPT}/.strip_env.sh" "${@}" +fi +unset SERENITY_STRIPPED_ENV + export MAKEJOBS="${MAKEJOBS:-$(nproc)}" maybe_source() { diff --git a/Ports/.strip_env.sh b/Ports/.strip_env.sh new file mode 100755 index 00000000000..54265ae7918 --- /dev/null +++ b/Ports/.strip_env.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +exec env -i SERENITY_STRIPPED_ENV=1 \ + MAKEJOBS="${MAKEJOBS:-}" \ + IN_SERENITY_PORT_DEV="${IN_SERENITY_PORT_DEV:-}" \ + SERENITY_ARCH="${SERENITY_ARCH:-}" \ + SERENITY_TOOLCHAIN="${SERENITY_TOOLCHAIN:-}" \ + "${@}"