From cdcf493249b582ee82a0d80a3c2624497d42d315 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Wed, 18 Jun 2014 11:42:58 +0200 Subject: [PATCH] xbps-triggers: remove __pycache__ dirs at remove time. --- srcpkgs/xbps-triggers/files/pycompile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/srcpkgs/xbps-triggers/files/pycompile b/srcpkgs/xbps-triggers/files/pycompile index 4ca7e0622e7..e0bdf02d1c6 100755 --- a/srcpkgs/xbps-triggers/files/pycompile +++ b/srcpkgs/xbps-triggers/files/pycompile @@ -64,12 +64,18 @@ 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 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 else rm -f usr/lib/python${pycompile_version}/site-packages/${f%.py}.py[co] fi