From: Manoj Srivastava
In the source package's Standards-Version control
@@ -2243,7 +2242,7 @@
To be precise, the string should match the following
Perl regular expression:
- These scripts should be the files preinst,
+ These scripts are the files preinst,
postinst, prerm and postrm in the
control area of the package. They must be proper executable
- files; if they are scripts (which is recommended) they must
+ files; if they are scripts (which is recommended), they must
start with the usual #! convention. They should be
readable and executable by anyone, and not world-writable.
- It is necessary for the error recovery procedures that the - scripts be idempotent: i.e., invoking the same script several - times in the same situation should do no harm. If the first - call failed, or aborted half way through for some reason, - the second call should merely do the things that were left - undone the first time, if any, and exit with a success - status. -
-When a package is upgraded a combination of the scripts from - the old and new packages is called in amongst the other - steps of the upgrade procedure. If your scripts are going - to be at all complicated you need to be aware of this, and - may need to check the arguments to your scripts. + the old and new packages is called during the upgrade + procedure. If your scripts are going to be at all + complicated you need to be aware of this, and may need to + check the arguments to your scripts.
@@ -2537,39 +2526,47 @@
Programs called from maintainer scripts should not
- normally have a path prepended to them. Before installation
- is started the package management system checks to see if
- the programs
+ Programs called from maintainer scripts should not normally
+ have a path prepended to them. Before installation is
+ started, the package management system checks to see if the
+ programs
- It is very important to make maintainer scripts
- idempotent.
-
- That means that if it runs successfully or fails
- and then you call it again it doesn't bomb out,
- but just ensures that everything is the way it
- ought to be.
+ This is so that if an error occurs, the user interrupts
+
old-postinst abort-upgrade - new version
+ new-versionconflictor's-postinst abort-remove
@@ -2719,10 +2716,11 @@
The procedure on installation/upgrade/overwrite/disappear
(i.e., when running dpkg --unpack, or the unpack
stage of dpkg --install) is as follows. In each
- case if an error occurs the actions are, in general, run
- backwards - this means that the maintainer scripts are run
- with different arguments in reverse order. These are the
- `error unwind' calls listed below.
+ case, if a major error occurs (unless listed below) the
+ actions are, in general, run backwards - this means that the
+ maintainer scripts are run with different arguments in
+ reverse order. These are the `error unwind' calls listed
+ below.
It is an error for a package to contains files which are on the system in another package, unless Replaces is used (see ). - Currently the --force-overwrite flag is +
@@ -2857,7 +2858,7 @@
Packages which overwrite each other's files produce - behavior which though deterministic is hard for the + behavior which, though deterministic, is hard for the system administrator to understand. It can easily lead to `missing' programs if, for example, a package is installed which overwrites a file from another @@ -2871,7 +2872,7 @@
- A directory will never be replaced by a symbolic links
+ A directory will never be replaced by a symbolic link
to a directory or vice versa; instead, the existing
state (symlink or not) will be left alone and
Any packages all of whose files have been overwritten during the
installation, and which aren't required for
dependencies, are considered to have been removed.
- For each such package,
+ For each such package
The new package's status is now sane, and recorded as
- `unpacked'. Here is another point of no return - if
- the conflicting package's removal fails we do not
- unwind the rest of the installation; the conflicting
- package is left in a half-removed limbo.
+ `unpacked'.
+
+ Here is another point of no return - if the
+ conflicting package's removal fails we do not unwind
+ the rest of the installation; the conflicting package
+ is left in a half-removed limbo.
If there was a conflicting package we go and do the
@@ -2997,7 +3003,7 @@
When we configure a package (this happens with dpkg
--install, or with --configure), we first
- update the conffiles and then call:
+ update any conffiles and then call:
- The package's files are removed (except conffiles).
+ The package's files are removed (except conffiles).
All the maintainer scripts except the postrm are removed.
+
+ All the maintainer scripts except the postrm
+ are removed.
If we aren't purging the package we stop here. Note
- that packages which have no postrm and no conffiles
- are automatically purged when removed, as there is no
- difference except for the
@@ -3066,7 +3074,8 @@