Browse Source

python(2): improve cache cleanup command

by using + instead of ;
android-5
Tom Yan 7 years ago
committed by Fredrik Fornwall
parent
commit
c4768ce96d
  1. 6
      packages/python/build.sh
  2. 2
      packages/python2/build.sh

6
packages/python/build.sh

@ -72,8 +72,8 @@ termux_step_post_massage () {
cp $TERMUX_PKG_TMPDIR/pyconfig.h $TERMUX_PREFIX/include/python${_MAJOR_VERSION}m/
mv $TERMUX_PKG_TMPDIR/pyconfig.h $TERMUX_PKG_MASSAGEDIR/$TERMUX_PREFIX/include/python${_MAJOR_VERSION}m/
cd $TERMUX_PKG_MASSAGEDIR
find . -path '*/__pycache__*' -delete
#FIXME: Is this necessary?
find $TERMUX_PKG_MASSAGEDIR -depth -name __pycache__ -exec rm -rf {} +
}
termux_step_create_debscripts () {
@ -93,7 +93,7 @@ termux_step_create_debscripts () {
# Uninstall everything installed through pip:
echo "pip freeze 2> /dev/null | xargs pip uninstall -y > /dev/null 2> /dev/null" >> prerm
# Cleanup __pycache__ folders:
echo "find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name __pycache__ -exec rm -rf {} \;" >> prerm
echo "find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name __pycache__ -exec rm -rf {} +" >> prerm
# Remove contents of site-packages/ folder:
echo "rm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/*" >> prerm
# Remove pip and easy_install installed by ensurepip in postinst:

2
packages/python2/build.sh

@ -95,7 +95,7 @@ termux_step_create_debscripts () {
# Uninstall everything installed through pip:
echo "pip2 freeze 2> /dev/null | xargs pip2 uninstall -y > /dev/null 2> /dev/null" >> prerm
# Cleanup *.pyc files
echo "find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name *.pyc -exec rm -rf {} \;" >> prerm
echo "find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name *.pyc -exec rm -rf {} +" >> prerm
# Remove contents of site-packages/ folder:
echo "rm -Rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/site-packages/*" >> prerm
# Remove pip and easy_install installed by ensurepip in postinst:

Loading…
Cancel
Save