Changes between Version 1 and Version 2 of MaintainerScripts


Ignore:
Timestamp:
01/19/11 12:36:24 (13 years ago)
Author:
jdreed
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MaintainerScripts

    v1 v2  
    11 == About maintainer scripts == 
     2 
     3(This is an abbreviated overview.  The full documentation is available [http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html here].( 
    24 
    35Maintainer 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. 
     
    911`command-which-might-fail || true` 
    1012 
    11  == Names == 
     13== Names == 
    1214 
    13 Each package can have up to 4 maintainer scripts: 
    14  * `preisnt`: 
     15Each package can have up to 4 maintainer scripts, which are placed in the `debian/` directory when building the package.  Like all debhelper files, they can be prepended with the package's name (e.g. package1.postinst). 
     16 * `postinst`:The package’s postinst maintainer script. 
     17 * `preinst`:The package’s postinst maintainer script. 
     18 * `postrm`:The package’s postinst maintainer script. 
     19 * `prerm`:The package’s postinst maintainer script. 
     20 
     21All scripts should include the tag `#DEBHELPER#` as the penultimate line of the script, should explicitly exit with status 0 at the end of the script, and should handle all possible arguments (see below).   When creating new maintainer scripts, you should use the examples in `/usr/share/debhelper/dh_make/debian/`.  In there, you'll fine `postinst.ex`, `preinst.ex`, etc.   
     22 
     23== Arguments == 
     24 
     25Each of the maintainer scripts can be called with a number of arguments that indicate what particular dpkg operation is going on.  Your script must be able to handle all possible arguments, and error out with unrecognized ones.  (Again, the examples described above do this for you already).  In most cases, however, you'll only handle one or two of the arguments.   Each of the examples in `/usr/share/debhelper/dh_make/debian/` contains a comment block at the top indicating all possible invocations. 
     26 
     27== Testing == 
     28 
     29When testing new packages, it's important to test both clean installs _and_ upgrades from previous versions.  It's possible to make a mistake such that installs work, but not upgrades (or vice versa).  This requires a lot of cleanup and can inconvenience many users.