From 647e48f7760454e95e5aef6110299846e18849b1 Mon Sep 17 00:00:00 2001 From: Luke Rohde Date: Wed, 2 Sep 2015 14:09:09 -0400 Subject: [PATCH 1/2] Delete all compiled python files when running hacking/env-setup --- hacking/env-setup | 2 ++ hacking/env-setup.fish | 1 + 2 files changed, 3 insertions(+) diff --git a/hacking/env-setup b/hacking/env-setup index 8ba483279b..2bd08b46d5 100644 --- a/hacking/env-setup +++ b/hacking/env-setup @@ -57,8 +57,10 @@ fi cd "$ANSIBLE_HOME" if [ "$verbosity" = silent ] ; then gen_egg_info > /dev/null 2>&1 + rm **/*.pyc > /dev/null 2>&1 else gen_egg_info + rm **/*.pyc fi cd "$current_dir" ) diff --git a/hacking/env-setup.fish b/hacking/env-setup.fish index 1b872f4dc0..079a10b47d 100644 --- a/hacking/env-setup.fish +++ b/hacking/env-setup.fish @@ -43,6 +43,7 @@ if test -e $PREFIX_PYTHONPATH/ansible*.egg-info rm -r $PREFIX_PYTHONPATH/ansible*.egg-info end mv ansible*egg-info $PREFIX_PYTHONPATH +rm **/*.pyc popd From cba4642d8d26a6547b1c73e6eef6104d29089ecb Mon Sep 17 00:00:00 2001 From: Luke Rohde Date: Wed, 2 Sep 2015 17:05:16 -0400 Subject: [PATCH 2/2] Use find ... -delete instead of non-portable globbing --- hacking/env-setup | 4 ++-- hacking/env-setup.fish | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hacking/env-setup b/hacking/env-setup index 2bd08b46d5..605e41dafb 100644 --- a/hacking/env-setup +++ b/hacking/env-setup @@ -57,10 +57,10 @@ fi cd "$ANSIBLE_HOME" if [ "$verbosity" = silent ] ; then gen_egg_info > /dev/null 2>&1 - rm **/*.pyc > /dev/null 2>&1 + find . -type f -name "*.pyc" -delete > /dev/null 2>&1 else gen_egg_info - rm **/*.pyc + find . -type f -name "*.pyc" -delete fi cd "$current_dir" ) diff --git a/hacking/env-setup.fish b/hacking/env-setup.fish index 079a10b47d..d0bc717905 100644 --- a/hacking/env-setup.fish +++ b/hacking/env-setup.fish @@ -43,7 +43,7 @@ if test -e $PREFIX_PYTHONPATH/ansible*.egg-info rm -r $PREFIX_PYTHONPATH/ansible*.egg-info end mv ansible*egg-info $PREFIX_PYTHONPATH -rm **/*.pyc +find . -type f -name "*.pyc" -delete popd