Changes between Version 2 and Version 3 of MaintainerScripts


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

--

Legend:

Unmodified
Added
Removed
Modified
  • MaintainerScripts

    v2 v3  
    2525Each 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. 
    2626 
     27== User Interaction == 
     28 
     29You don't necessarily get a controlling terminal in maintainer scripts, and thus can't interact directly with the user using normal shell scripting techniques.  However, a log of maintainer script output is stored, and you should feel free to be verbose with error messages.  Because maintainer scripts which use `set -e` will error out immediately upon a command failure, it's best to clearly comment your code and/or catch some obscure errors and print more info to the terminal. 
     30 
     31Example: `command-which-might-fail || echo "Couldn't rebuild cache, see /var/log/something" && exit 1` 
     32 
     33If you do need to interact with the user, you'll want to use Debconf. 
     34 
     35TODO: Document Debconf usage 
     36 
    2737== Testing == 
    2838