Commit 88443d6d by Brian Coca

Merge pull request #7306 from abadger/feature/egg-info

Feature/egg info
parents bd5b28e4 f7b76e03
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
####################################################### #######################################################
#__requires__ = ['ansible'] __requires__ = ['ansible']
#import pkg_resources import pkg_resources
import sys import sys
import os import os
......
...@@ -18,8 +18,8 @@ ...@@ -18,8 +18,8 @@
# ansible-vault is a script that encrypts/decrypts YAML files. See # ansible-vault is a script that encrypts/decrypts YAML files. See
# http://docs.ansible.com/playbooks_vault.html for more details. # http://docs.ansible.com/playbooks_vault.html for more details.
#__requires__ = ['ansible'] __requires__ = ['ansible']
#import pkg_resources import pkg_resources
import os import os
import sys import sys
......
...@@ -23,6 +23,30 @@ PREFIX_MANPATH="$ANSIBLE_HOME/docs/man" ...@@ -23,6 +23,30 @@ PREFIX_MANPATH="$ANSIBLE_HOME/docs/man"
[[ $PATH != ${PREFIX_PATH}* ]] && export PATH=$PREFIX_PATH:$PATH [[ $PATH != ${PREFIX_PATH}* ]] && export PATH=$PREFIX_PATH:$PATH
[[ $MANPATH != ${PREFIX_MANPATH}* ]] && export MANPATH=$PREFIX_MANPATH:$MANPATH [[ $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 # Print out values unless -q is set
if [ $# -eq 0 -o "$1" != "-q" ] ; then if [ $# -eq 0 -o "$1" != "-q" ] ; then
...@@ -33,7 +57,7 @@ if [ $# -eq 0 -o "$1" != "-q" ] ; then ...@@ -33,7 +57,7 @@ if [ $# -eq 0 -o "$1" != "-q" ] ; then
echo "PYTHONPATH=$PYTHONPATH" echo "PYTHONPATH=$PYTHONPATH"
echo "MANPATH=$MANPATH" echo "MANPATH=$MANPATH"
echo "" echo ""
echo "Remember, you may wish to specify your host file with -i" echo "Remember, you may wish to specify your host file with -i"
echo "" echo ""
echo "Done!" echo "Done!"
......
...@@ -36,6 +36,16 @@ end ...@@ -36,6 +36,16 @@ end
set -gx ANSIBLE_LIBRARY $ANSIBLE_HOME/library set -gx ANSIBLE_LIBRARY $ANSIBLE_HOME/library
# Generate egg_info so that pkg_resources works
pushd $ANSIBLE_HOME
python setup.py egg_info
if test -e $PREFIX_PYTHONPATH/ansible*.egg-info
rm -r $PREFIX_PYTHONPATH/ansible*.egg-info
end
mv ansible*egg-info $PREFIX_PYTHONPATH
popd
if set -q argv if set -q argv
switch $argv switch $argv
case '-q' '--quiet' case '-q' '--quiet'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment