From 04f079569edd371aac842d1d4e8139c08a685fb0 Mon Sep 17 00:00:00 2001 From: jaimergp Date: Thu, 29 Feb 2024 11:29:48 +0100 Subject: [PATCH] Do not render progress bars when SH installers are run with `-b` (batch) (#757) * set CONDA_QUIET to the value of $BATCH * add news --- constructor/header.sh | 7 ++++++- news/757-progress-bars | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 news/757-progress-bars diff --git a/constructor/header.sh b/constructor/header.sh index eb76cc6b..0fdbee3b 100644 --- a/constructor/header.sh +++ b/constructor/header.sh @@ -431,12 +431,14 @@ fi # the second binary payload: the tarball of packages printf "Unpacking payload ...\n" extract_range $boundary1 $boundary2 | \ - "$CONDA_EXEC" constructor --extract-tarball --prefix "$PREFIX" + CONDA_QUIET="$BATCH" "$CONDA_EXEC" constructor --extract-tarball --prefix "$PREFIX" PRECONDA="$PREFIX/preconda.tar.bz2" +CONDA_QUIET="$BATCH" \ "$CONDA_EXEC" constructor --prefix "$PREFIX" --extract-tarball < "$PRECONDA" || exit 1 rm -f "$PRECONDA" +CONDA_QUIET="$BATCH" \ "$CONDA_EXEC" constructor --prefix "$PREFIX" --extract-conda-pkgs || exit 1 #The templating doesn't support nested if statements @@ -495,6 +497,7 @@ CONDA_SAFETY_CHECKS=disabled \ CONDA_EXTRA_SAFETY_CHECKS=no \ CONDA_CHANNELS="__CHANNELS__" \ CONDA_PKGS_DIRS="$PREFIX/pkgs" \ +CONDA_QUIET="$BATCH" \ "$CONDA_EXEC" install --offline --file "$PREFIX/pkgs/env.txt" -yp "$PREFIX" $shortcuts || exit 1 rm -f "$PREFIX/pkgs/env.txt" @@ -539,6 +542,7 @@ for env_pkgs in "${PREFIX}"/pkgs/envs/*/; do CONDA_EXTRA_SAFETY_CHECKS=no \ CONDA_CHANNELS="$env_channels" \ CONDA_PKGS_DIRS="$PREFIX/pkgs" \ + CONDA_QUIET="$BATCH" \ "$CONDA_EXEC" install --offline --file "${env_pkgs}env.txt" -yp "$PREFIX/envs/$env_name" $env_shortcuts || exit 1 rm -f "${env_pkgs}env.txt" done @@ -547,6 +551,7 @@ done __INSTALL_COMMANDS__ POSTCONDA="$PREFIX/postconda.tar.bz2" +CONDA_QUIET="$BATCH" \ "$CONDA_EXEC" constructor --prefix "$PREFIX" --extract-tarball < "$POSTCONDA" || exit 1 rm -f "$POSTCONDA" rm -rf "$PREFIX/install_tmp" diff --git a/news/757-progress-bars b/news/757-progress-bars new file mode 100644 index 00000000..dece33bd --- /dev/null +++ b/news/757-progress-bars @@ -0,0 +1,19 @@ +### Enhancements + +* Do not render progress bars when SH installers are run with `-b` (batch). (#756 via #757) + +### Bug fixes + +* + +### Deprecations + +* + +### Docs + +* + +### Other + +*