| 1 | #!/bin/sh |
| 2 | |
| 3 | set -euxf |
| 4 | |
| 5 | pkg=$1 |
| 6 | |
| 7 | find debian/$pkg \ |
| 8 | -name '*.pyc' -delete |
| 9 | find debian/$pkg \ |
| 10 | -name '__pycache__' -delete |
| 11 | |
| 12 | # Don't need these, and lintian will make a noise about them |
| 13 | find debian/$pkg \( \ |
| 14 | -name 'regen' \ |
| 15 | -o -name '*.bat' \ |
| 16 | -o -name 'fetch_*' \ |
| 17 | -o -name '*.pickle' \ |
| 18 | \) -delete |
| 19 | |
| 20 | # Remove empty directories, because pypy3clean will |
| 21 | find debian/$pkg/usr/lib/pypy3.11 -type d -empty -delete |
| 22 | |
| 23 | # Nothing in the stdlib should be executable |
| 24 | chmod -R a-x+X debian/$pkg/usr/lib/pypy3.11/ |
| 25 | |
| 26 | # Fix interpreters |
| 27 | find debian/$pkg \ |
| 28 | -name '*.py' -print0 \ |
| 29 | | xargs -0 sed -i -e '1s|^#!.*python.*|#!/usr/bin/pypy3|' |