diff --git a/srcpkgs/xbps-triggers/files/pycompile b/srcpkgs/xbps-triggers/files/pycompile index e0bdf02d1c6..7e69816f62c 100755 --- a/srcpkgs/xbps-triggers/files/pycompile +++ b/srcpkgs/xbps-triggers/files/pycompile @@ -64,18 +64,15 @@ remove() for f in ${pycompile_dirs}; do echo "Removing byte-compiled python${pycompile_version} files in ${f}..." find ${f} -type f -name \*.py[co] -delete 2>&1 >/dev/null - if [ -d "${f}/__pycache__" ]; then - rm -rf "${f}/__pycache__" 2>&1 >/dev/null - fi + find ${f} -type d -name __pycache__ -delete 2>&1 >/dev/null done for f in ${pycompile_module}; do echo "Removing byte-compiled python${pycompile_version} code for module ${f}..." if [ -d usr/lib/python${pycompile_version}/site-packages/${f} ]; then find usr/lib/python${pycompile_version}/site-packages/${f} \ -type f -name \*.py[co] -delete 2>&1 >/dev/null - if [ -d "usr/lib/python${pycompile_version}/site-packages/${f}/__pycache__" ]; then - rm -rf "usr/lib/python${pycompile_version}/site-packages/${f}/__pycache__" 2>&1 >/dev/null - fi + find usr/lib/python${pycompile_version}/site-packages/${f} \ + -type d -name __pycache__ -delete 2>&1 >/dev/null else rm -f usr/lib/python${pycompile_version}/site-packages/${f%.py}.py[co] fi