Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Status
Ready for review
Description of Changes
We are currently cleaning the Python cache in the postinst and postrm, but that still leaves us with warnings from apt that non-empty
__pycache__
directories couldn't be deleted.This mimics what dh-python does, which is to run py3compile in the postinst (already doing) and run py3clean in the prerm.
During a fresh install, only the postinst is triggered to compile the cache.
During an upgrade, first the prerm runs, removing the cache, then the new version is unpacked, then postinst goes, recreating the cache.
Fixes #6743.
Testing
make build-debs
with this PR,sudo apt install ./securedrop-app-code....deb
/opt/venvs/securedrop-app-code/lib/python3.8/site-packages/passlib/
no longer exists__pycache__
folders were created and are owned by root.Deployment
Any special considerations for deployment? Considered, see above for explanation.
Checklist