mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-27 23:21:22 -07:00
Teach env-setup how to create egg-info for ansible so that pkg_resources works
This commit is contained in:
parent
51dfd18e1f
commit
6a6060ac55
2 changed files with 35 additions and 1 deletions
|
@ -25,6 +25,30 @@ unset ANSIBLE_LIBRARY
|
||||||
export ANSIBLE_LIBRARY="$ANSIBLE_HOME/library:`python $HACKING_DIR/get_library.py`"
|
export ANSIBLE_LIBRARY="$ANSIBLE_HOME/library:`python $HACKING_DIR/get_library.py`"
|
||||||
[[ $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
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue