-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
Showing
3 changed files
with
40 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/sh | ||
# prerm script for securedrop-app-code | ||
# | ||
# See: dh_installdeb(1). | ||
|
||
set -e | ||
|
||
# Summary of how this script can be called: | ||
# * <prerm> 'remove' | ||
# * <old-prerm> 'upgrade' <new-version> | ||
# * <new-prerm> 'failed-upgrade' <old-version> | ||
# * <conflictor's-prerm> 'remove' 'in-favour' <package> <new-version> | ||
# * <deconfigured's-prerm> 'deconfigure' 'in-favour' | ||
# <package-being-installed> <version> 'removing' | ||
# <conflicting-package> <version> | ||
# for details, see https://www.debian.org/doc/debian-policy/ or | ||
# the debian-policy package. | ||
|
||
|
||
case "$1" in | ||
remove|upgrade|deconfigure) | ||
py3clean /opt/venvs/securedrop-app-code | ||
py3clean /var/www/securedrop | ||
;; | ||
|
||
failed-upgrade) | ||
;; | ||
|
||
*) | ||
echo "prerm called with unknown argument '$1'" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
# dh_installdeb will replace this with shell code automatically | ||
# generated by other debhelper scripts. | ||
|
||
#DEBHELPER# | ||
|
||
exit 0 |