From a7db3e8d2c55684dbe34ecf4ce460fba3be97fef Mon Sep 17 00:00:00 2001 From: Chris Evich Date: Thu, 2 Feb 2023 15:43:25 -0500 Subject: [PATCH] Cirrus: Omit functions in env. file The `localbenchmarks()` function stores a `.env` file containing current environment variables for benchmark-classification purposes. However its naked use of `printenv` means it was logging the contents of library functions and (worse) trying to stort all the lines. This results in an unusable mess inside `benchmarks.env`. Fix this by re-using the purpose-built passthrough_envars() which is designed to only print useful, safe, env. vars. Signed-off-by: Chris Evich --- contrib/cirrus/lib.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/cirrus/lib.sh b/contrib/cirrus/lib.sh index 2f4e913abf..0f403ef1c8 100644 --- a/contrib/cirrus/lib.sh +++ b/contrib/cirrus/lib.sh @@ -328,16 +328,19 @@ remove_packaged_podman_files() { # Execute make localbenchmarks in $CIRRUS_WORKING_DIR/data # for preserving as a task artifact. localbenchmarks() { - local datadir + local datadir envnames envname req_env_vars DISTRO_NV PODBIN_NAME PRIV_NAME TEST_ENVIRON TEST_FLAVOR req_env_vars VM_IMAGE_NAME EC2_INST_TYPE datadir=$CIRRUS_WORKING_DIR/data mkdir -p $datadir + envnames=$(passthrough_envars | sort); ( echo "# Env. var basis for benchmarks benchmarks." - printenv | grep -Ev "$SECRET_ENV_RE" | sort + for envname in $envnames; do + printf "$envname=%q\n" "${!envname}" + done echo "# Machine details for data-comparison sake, not actual env. vars." # Checked above in req_env_vars