File: prerm-py3clean

package info (click to toggle)
dh-python 6.20251201
  • links: PTS, VCS
  • area: main
  • in suites: forky
  • size: 1,564 kB
  • sloc: python: 5,110; makefile: 578; perl: 249; sh: 36
file content (6 lines) | stat: -rw-r--r-- 316 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
if command -v py3clean >/dev/null 2>&1 && python3 -c 'pass' 2>/dev/null; then
	py3clean -p #PACKAGE# #ARGS#
else
	dpkg -L #PACKAGE# | sed -En -e '/^(.*)\/(.+)\.py$/s,,rm "\1/__pycache__/\2".*,e'
	find /usr/lib/python3/dist-packages/ -type d -name __pycache__ -empty -print0 | xargs --null --no-run-if-empty rmdir
fi