Le sam. 12 août 2023 à 20:16, Paul Gevers <[email protected]> a écrit :
>
> Call me innocent, but I'm not even seeing cache files on my system for
> the recent python. When are these files created?
>
> Paul
I think I just ran autopkgtest once, as root, on this day at 2am...
I think I should sleep more.
So they are created anytime a user with write access to
/usr/share/autopkgtest/lib
run autopkgtest, which means root.
dh_python3 would add the calls to py3compile/py3clean,
but might have other side effects for your package that have to be
backportable to oldstable(?not sure) so you might consider calling
py3{compile/clean} directly.
Not having the .pyc files at all induce a tiny performance drop.
Another attempt right now:
$ ls -l /usr/share/autopkgtest/lib/__pycache__/*310*.pyc --full-time
-rw-r--r-- 1 root root 4276 2022-11-03 02:34:17.512478073 +0100
/usr/share/autopkgtest/lib/__pycache__/adt_binaries.cpython-310.pyc
-rw-r--r-- 1 root root 2940 2022-11-03 02:34:17.412477486 +0100
/usr/share/autopkgtest/lib/__pycache__/adtlog.cpython-310.pyc
-rw-r--r-- 1 root root 40030 2022-11-03 02:34:17.488477932 +0100
/usr/share/autopkgtest/lib/__pycache__/adt_testbed.cpython-310.pyc
-rw-r--r-- 1 root root 12270 2022-11-03 02:34:17.520478120 +0100
/usr/share/autopkgtest/lib/__pycache__/autopkgtest_args.cpython-310.pyc
-rw-r--r-- 1 root root 17628 2022-11-03 02:34:17.428477580 +0100
/usr/share/autopkgtest/lib/__pycache__/testdesc.cpython-310.pyc
-rw-r--r-- 1 root root 21171 2022-11-03 02:34:17.508478050 +0100
/usr/share/autopkgtest/lib/__pycache__/VirtSubproc.cpython-310.pyc
Original timestamps, that don't match any release date or migration to testing
or the time of day when unattended-upgrades run:
tchet@brix ~/git/cruft-ng $ ls -l
/usr/share/autopkgtest/lib/__pycache__/*311*.pyc --full-time
-rw-r--r-- 1 root root 7748 2023-08-12 20:52:27.131803347 +0200
/usr/share/autopkgtest/lib/__pycache__/adt_binaries.cpython-311.pyc
-rw-r--r-- 1 root root 5248 2023-08-12 20:52:27.067803064 +0200
/usr/share/autopkgtest/lib/__pycache__/adtlog.cpython-311.pyc
-rw-r--r-- 1 root root 79617 2023-08-12 20:52:27.179803560 +0200
/usr/share/autopkgtest/lib/__pycache__/adt_testbed.cpython-311.pyc
-rw-r--r-- 1 root root 21495 2023-08-12 20:52:27.215803720 +0200
/usr/share/autopkgtest/lib/__pycache__/autopkgtest_args.cpython-311.pyc
-rw-r--r-- 1 root root 31364 2023-08-12 20:52:27.087803152 +0200
/usr/share/autopkgtest/lib/__pycache__/testdesc.cpython-311.pyc
-rw-r--r-- 1 root root 41735 2023-08-12 20:52:27.203803667 +0200
/usr/share/autopkgtest/lib/__pycache__/VirtSubproc.cpython-311.pyc
Some minimal package that do the right thing:
$ cat /var/lib/dpkg/info/python3-six.postinst
# Automatically added by dh_python3
if command -v py3compile >/dev/null 2>&1; then
py3compile -p python3-six
fi
# End automatically added section
$ cat /var/lib/dpkg/info/python3-six.prerm
# Automatically added by dh_python3
if command -v py3clean >/dev/null 2>&1; then
py3clean -p python3-six
fi
# End automatically added section