python: Better cleanup of __pycache__ folders
authorFredrik Fornwall <fredrik@fornwall.net>
Mon, 4 Jul 2016 22:18:29 +0000 (18:18 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Mon, 4 Jul 2016 22:18:29 +0000 (18:18 -0400)
Fixes #87, so future updates of the python package should not
require ranger having to be re-installed.

packages/python/build.sh
packages/python2/build.sh

index 7714afb..e2e9e41 100644 (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
 
index d8e20ef..6da2ae0 100644 (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