python: Better cleanup of __pycache__ folders

Fixes #87, so future updates of the python package should not
require ranger having to be re-installed.
This commit is contained in:
Fredrik Fornwall 2016-07-04 18:18:29 -04:00
parent 194d5509d7
commit 315a0ef6f9
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ termux_step_create_debscripts () {
## PRE RM:
echo "pip freeze 2> /dev/null | xargs pip uninstall -y > /dev/null 2> /dev/null" > prerm
# Cleanup __pycache__ folders
echo "rm -rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/" >> prerm
echo "find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name __pycache__ -exec rm -rf {} \;" >> prerm
echo "rm -f $TERMUX_PREFIX/bin/pip $TERMUX_PREFIX/bin/pip3*" >> prerm
echo "exit 0" >> prerm

View File

@ -68,7 +68,7 @@ termux_step_create_debscripts () {
## PRE RM:
echo "pip2 freeze 2> /dev/null | xargs pip2 uninstall -y > /dev/null 2> /dev/null" > prerm
# Cleanup __pycache__ folders
echo "rm -rf $TERMUX_PREFIX/lib/python${_MAJOR_VERSION}/" >> prerm
echo "find $TERMUX_PREFIX/lib/python${_MAJOR_VERSION} -depth -name __pycache__ -exec rm -rf {} \;" >> prerm
echo "rm -f $TERMUX_PREFIX/bin/pip2*" >> prerm
echo "exit 0" >> prerm