Skip to content

Commit

Permalink
Make postrm commands optional
Browse files Browse the repository at this point in the history
Per
<https://www.debian.org/doc/debian-policy/ch-relationships.html#binary-dependencies-depends-recommends-suggests-enhances-pre-depends>:

> Finally, the Depends field should be used if the depended-on package
> is needed by the postrm script to fully clean up after the package
> removal. There is no guarantee that package dependencies will be
> available when postrm is run, but the depended-on package is more
> likely to be available if the package declares a dependency
> (particularly in the case of postrm remove). The postrm script must
> gracefully skip actions that require a dependency if that dependency
> isn’t available.
  • Loading branch information
legoktm committed Feb 8, 2024
1 parent c696c8f commit 54dddd5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions debian/securedrop-export.postrm
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,14 @@ set -e
case "$1" in
purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)

update-desktop-database /usr/share/applications
update-mime-database /usr/share/mime
# There is no guarantees dependencies are available in postrm, so
# conditionally issue these updates.
if [[ -x "/usr/bin/update-desktop-database" ]]; then
update-desktop-database /usr/share/applications
fi
if [[ -x "/usr/bin/update-mime-database" ]]; then
update-mime-database /usr/share/mime
fi
;;

*)
Expand Down

0 comments on commit 54dddd5

Please sign in to comment.