From b8225603a5d66760445c04ec14861764deb1489f Mon Sep 17 00:00:00 2001
From: Christian Franke
- In addition to the ordinary ("run-once") post-install scripts described above,
- the setup program supports "perpetual" post-install scripts. These are run on
- every invocation of setup, as long as the package is still installed.
- Perpetual post-install scripts are distinguished from run-once scripts by
+ In addition to the ordinary ("run-once") scripts described above,
+ the setup program supports "perpetual" post-install and pre-remove scripts.
+ These are run on every invocation of setup, as long as the package is still
+ installed. Perpetual scripts are distinguished from run-once scripts by
having names that start with "0p_" or "zp_". Those that start with "0p_" are
- run before the run-once scripts, and those that start with "zp_" are run after
- the run-once scripts. Examples include
- 0p_000_autorebase.dash
(provided by the _autorebase
package)
- and 0p_update-info-dir.dash
(provided by the info
package).
+ run before the run-once scripts, and those that start with "zp_" are run
+ after the run-once scripts. Examples include
+ postinstall/0p_000_autorebase.dash
(provided by the
+ _autorebase
package),
+ postinstall/0p_update-info-dir.dash
(provided by the
+ info
package),
+ postinstall/zp_zzz_etckeeper_post-install.sh
and
+ preremove/0p_000_etckeeper_pre-install.sh
(provided by the
+ etckeeper
package).
For those package maintainers wanting to employ perpetual scripts, the first - thing to keep in mind is to only use this feature for things that really can't - be done with run-once scripting. Any perpetual script should minimize the - resources used (use dash instead of bash for instance) and exit at the - earliest possible moment if no action is required. Scripts of type "0p_" must - be able to run with the Base packages installed but the post-install scripts - not yet executed; in practical terms that rules out using bash scripts. This - limitation does not apply to scripts of type "zp_". + thing to keep in mind is to only use this feature for things that really + can't be done with run-once scripting. Any perpetual script should minimize + the resources used (use dash instead of bash for instance) and exit at the + earliest possible moment if no action is required. Post-install scripts of + type "0p_" must be able to run with the Base packages installed but the + remaining post-install scripts not yet executed; in practical terms that + rules out using bash scripts. Pre-remove scripts of type "zp_" must be able + to run with the other pre-remove scripts already executed. These limitations + do not apply to post-install scripts of type "zp_" and pre-remove scripts of + type "0p_".
See this -- 2.36.1