From e6f63be7a444aba8df1678514566c38bdae0627f Mon Sep 17 00:00:00 2001 From: Philip Douglass Date: Fri, 4 Mar 2022 16:04:54 -0500 Subject: [PATCH] Honor `--quiet` parameter properly in fish shell (#77180) * The `^` stderr redirection is deprecated * Setting `-q` for `setup.py` in `gen_egg_info` is redundant --- .../fragments/77180-fix-fish-env-setup-script.yml | 3 +++ hacking/env-setup.fish | 11 +++-------- 2 files changed, 6 insertions(+), 8 deletions(-) create mode 100644 changelogs/fragments/77180-fix-fish-env-setup-script.yml diff --git a/changelogs/fragments/77180-fix-fish-env-setup-script.yml b/changelogs/fragments/77180-fix-fish-env-setup-script.yml new file mode 100644 index 00000000000..ace8cc81fc1 --- /dev/null +++ b/changelogs/fragments/77180-fix-fish-env-setup-script.yml @@ -0,0 +1,3 @@ +bugfixes: + - hacking - fix incorrect usage of deprecated fish-shell redirection operators + that failed to honor ``--quiet`` flag when sourced (https://github.com/ansible/ansible/pull/77180). diff --git a/hacking/env-setup.fish b/hacking/env-setup.fish index 944c029ff9b..badc735acba 100644 --- a/hacking/env-setup.fish +++ b/hacking/env-setup.fish @@ -80,20 +80,15 @@ function gen_egg_info rm -rf $PREFIX_PYTHONPATH/ansible*.egg-info end - if [ $QUIET ] - set options '-q' - end - - eval $PYTHON_BIN setup.py $options egg_info - + eval $PYTHON_BIN setup.py egg_info end pushd $ANSIBLE_HOME if [ $QUIET ] - gen_egg_info ^ /dev/null - find . -type f -name "*.pyc" -exec rm -f '{}' ';' ^ /dev/null + gen_egg_info &> /dev/null + find . -type f -name "*.pyc" -exec rm -f '{}' ';' &> /dev/null else gen_egg_info find . -type f -name "*.pyc" -exec rm -f '{}' ';'