summaryrefslogtreecommitdiff
path: root/hacking/env-setup
diff options
context:
space:
mode:
authorBrian Coca <bcoca@ansible.com>2014-12-15 16:26:37 -0500
committerBrian Coca <bcoca@ansible.com>2014-12-15 16:26:37 -0500
commit88443d6dcfe3201717d0b3b296d04450103fbf83 (patch)
tree629b026f15af5cd0474b88f697b74a4b1c226d20 /hacking/env-setup
parentbd5b28e4298723dba3a36547099fef1076ed5896 (diff)
parentf7b76e0394ad2eb59f4aef6497fd89ce664e8718 (diff)
downloadansible-88443d6dcfe3201717d0b3b296d04450103fbf83.tar.gz
Merge pull request #7306 from abadger/feature/egg-info
Feature/egg info
Diffstat (limited to 'hacking/env-setup')
-rwxr-xr-xhacking/env-setup26
1 files changed, 25 insertions, 1 deletions
diff --git a/hacking/env-setup b/hacking/env-setup
index 4fed169097..59bc7c21f3 100755
--- a/hacking/env-setup
+++ b/hacking/env-setup
@@ -23,6 +23,30 @@ PREFIX_MANPATH="$ANSIBLE_HOME/docs/man"
[[ $PATH != ${PREFIX_PATH}* ]] && export PATH=$PREFIX_PATH:$PATH
[[ $MANPATH != ${PREFIX_MANPATH}* ]] && export MANPATH=$PREFIX_MANPATH:$MANPATH
+#
+# Generate egg_info so that pkg_resources works
+#
+
+# Do the work in a function so we don't repeat ourselves later
+gen_egg_info()
+{
+ python setup.py egg_info
+ if [ -e $PREFIX_PYTHONPATH/ansible*.egg-info ] ; then
+ rm -r $PREFIX_PYTHONPATH/ansible*.egg-info
+ fi
+ mv ansible*.egg-info $PREFIX_PYTHONPATH
+}
+
+# In some shells if pushd is a no-op then popd sends you to a previous
+# directory in history
+if [ "$ANSIBLE_HOME" != "$PWD" ] ; then
+ pushd "$ANSIBLE_HOME"
+ gen_egg_info
+ popd
+else
+ gen_egg_info
+fi
+
# Print out values unless -q is set
if [ $# -eq 0 -o "$1" != "-q" ] ; then
@@ -33,7 +57,7 @@ if [ $# -eq 0 -o "$1" != "-q" ] ; then
echo "PYTHONPATH=$PYTHONPATH"
echo "MANPATH=$MANPATH"
echo ""
-
+
echo "Remember, you may wish to specify your host file with -i"
echo ""
echo "Done!"