Skip to content

Commit

Permalink
fixed a bug where after compiling some python modules keep referencin…
Browse files Browse the repository at this point in the history
…g full paths for pth files created in site-packages folder
  • Loading branch information
jriguera committed Jul 5, 2017
1 parent f9343c2 commit e357901
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 1 deletion.
6 changes: 6 additions & 0 deletions packages/ansible/packaging
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,12 @@ if [ -e "requirements.txt" ]; then
pip install --prefix=${BOSH_INSTALL_TARGET} --compile -r requirements.txt
fi

# remove full path in *.pth
for pth in $(ls ${BOSH_INSTALL_TARGET}/lib/python*/site-packages/*.pth 2>/dev/null); do
echo "Changing full path in: $pth"
sed -i -e 's:^/var/vcap/data/packages/.*/site-packages:.:' $pth
done

# Install shell helpers
echo "Adding shell helpers ..."
cp -av _helpers ${BOSH_INSTALL_TARGET}/
Expand Down
6 changes: 6 additions & 0 deletions packages/pip/packaging
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,9 @@ for pyf in ${BOSH_INSTALL_TARGET}/bin/*; do
fi
done

# remove full path in *.pth
for pth in $(ls ${BOSH_INSTALL_TARGET}/lib/python*/site-packages/*.pth 2>/dev/null); do
echo "Changing full path in: $pth"
sed -i -e 's:^/var/vcap/data/packages/.*/site-packages:.:' $pth
done

8 changes: 7 additions & 1 deletion packages/python27/packaging
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export LD_LIBRARY_PATH="${LIBRARY_PATH}"
echo "Building and installing Python ... "
pushd Python-${PYTHON_VERSION}
./configure --enable-optimizations --prefix=${BOSH_INSTALL_TARGET}
make
make -j 4
make install
popd

Expand All @@ -39,3 +39,9 @@ for pyf in ${BOSH_INSTALL_TARGET}/bin/*; do
fi
done

# remove full path in setuptools.pth
for pth in $(ls ${BOSH_INSTALL_TARGET}/lib/python*/site-packages/*.pth 2>/dev/null); do
echo "Changing full path in: $pth"
sed -i -e 's:^/var/vcap/data/packages/.*/site-packages:.:' $pth
done

6 changes: 6 additions & 0 deletions packages/setuptools/packaging
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ for pyf in ${BOSH_INSTALL_TARGET}/bin/*; do
fi
done

# remove full path in setuptools.pth
for pth in $(ls ${BOSH_INSTALL_TARGET}/lib/python*/site-packages/*.pth 2>/dev/null); do
echo "Changing full path in: $pth"
sed -i -e 's:^/var/vcap/data/packages/.*/site-packages:.:' $pth
done

0 comments on commit e357901

Please sign in to comment.