wiki:MaintainerScripts

Version 1 (modified by jdreed, 10 years ago) (diff)

--

About maintainer scripts

Maintainer scripts are, as the name implies, scripts created by the maintainer of a Debian package to aid in its installation, removable or upgrade. Specifically, there are often times when merely installing some files is not sufficient, and action must be taken upon successful installation (rebuilding a cache, etc). Most common operations (e.g., ldconfig) are automatic, but for cases when you need to specify custom actions, you would use maintainer scripts.

Maintainer scripts must be  idempotent, in that running them multiple times must not produce different results.

Maintainer scripts must exit with status 0 upon successful completion, or any non-zero status otherwise. For this reason, most maintainer scripts use set -e at the beginning of the script, which causes Bash to error out if any command returns non-zero status. You can combine this with an or (||) clause to catch non-fatal errors. e.g.

command-which-might-fail || true

Names

Each package can have up to 4 maintainer scripts:

  • preisnt: