summaryrefslogtreecommitdiffstats
path: root/hacking/env-setup
diff options
context:
space:
mode:
authorToshio Kuratomi <toshio@fedoraproject.org>2014-05-06 20:19:41 +0200
committerToshio Kuratomi <toshio@fedoraproject.org>2014-05-06 20:19:41 +0200
commit6a6060ac5591a34386cdd03d1148d7063db77372 (patch)
tree870eefde96527c8c414b2ceac67d76c59afa320d /hacking/env-setup
parentMerge pull request #7301 from berendt/check_against_lowered_sha256sum (diff)
downloadansible-6a6060ac5591a34386cdd03d1148d7063db77372.tar.xz
ansible-6a6060ac5591a34386cdd03d1148d7063db77372.zip
Teach env-setup how to create egg-info for ansible so that pkg_resources works
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 6e4de1af72..032611b2ae 100755
--- a/hacking/env-setup
+++ b/hacking/env-setup
@@ -25,6 +25,30 @@ unset ANSIBLE_LIBRARY
export ANSIBLE_LIBRARY="$ANSIBLE_HOME/library:`python $HACKING_DIR/get_library.py`"
[[ $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
@@ -36,7 +60,7 @@ if [ $# -eq 0 -o "$1" != "-q" ] ; then
echo "ANSIBLE_LIBRARY=$ANSIBLE_LIBRARY"
echo "MANPATH=$MANPATH"
echo ""
-
+
echo "Remember, you may wish to specify your host file with -i"
echo ""
echo "Done!"