Python 3.2, and later 3.5, has changed how the cache of compiled Python files work:
We need to update our %ghost entries in our RPMs to deal with this.
Debian still lacks %ghost support (bug 7586), but we might want to look how it handles this situation.
A major problem with the new approach is that there is a potentially unknown part of the cache filenames. Even if we assume it's just CPython there is still a version number that could be anything. And %ghost doesn't allow globbing, so we can't have it grab everything.
Debian handles this by globbing in their prerm scripts. However this fails to handle "rpm -qf" or "rpm -ql".
I suppose we'll have to guess how many versions of CPython might be released before a particular version of ThinLinc is obsolete. At minimum we would need to include the three years that a ThinLinc release is supported.
Python has decided on one major release a year, so that would be a minimum of three future versions:
A major downside to this approach is a lot of spam in "rpm -ql" for a package as all %ghost entries are included there.
To keep the number of entries down somewhat we could at least omit the optimised versions. We don't currently include those (for Python 2), and I'm not sure under what circumstances customers might actually be forcing Python to optimise things.
Done. Tester should check that "rpm -qf" works, and old files are removed on install and upgrade.
Tested installation/uninstallation and upgrades with nighlty build 6672:
- pyc files all belong to a package (rpm -qf)
- All pyc files are removed
* Upgrading (Check that all pyc files belong to correct package version)
- 4.12 -> nightly 6672
- nightly 6669 -> 6672 (both containing these relevant changes)