xbps-triggers: remove __pycache__ dirs at remove time.
This commit is contained in:
parent
446b11b44f
commit
cdcf493249
1 changed files with 6 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue