File: public_modules.rtremove

package info (click to toggle)
python3-defaults 3.13.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 660 kB
  • sloc: python: 1,282; makefile: 391; sh: 107
file content (20 lines) | stat: -rwxr-xr-x 648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#! /bin/sh
set -e

VERSION=${2#python}
if which py3clean >/dev/null 2>&1; then
	if [ "$VERSION" = 3.1 ]; then
		find /usr/lib/python3.1/dist-packages -name '*.py[co]' -delete
        find /usr/lib/python3/dist-packages -name '*.py[co]' -delete
	else
		py3clean -V $VERSION /usr/lib/python3/dist-packages
	fi
else
	if [ "$VERSION" = 3.1 ]; then
		find /usr/lib/python3.1/dist-packages -name '*.py[co]' -delete
	else
		TAG=`python$VERSION -c "import sys; print(sys.implementation.cache_tag)"` \
		find /usr/lib/python3/dist-packages -name "*.$TAG.py[co]" -delete
		find /usr/lib/python3/dist-packages -depth -empty -name '__pycache__' -delete
	fi
fi