Changes between Version 2 and Version 3 of MaintainerScripts
- Timestamp:
- 01/19/11 12:42:28 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
MaintainerScripts
v2 v3 25 25 Each 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 26 27 == User Interaction == 28 29 You 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 31 Example: `command-which-might-fail || echo "Couldn't rebuild cache, see /var/log/something" && exit 1` 32 33 If you do need to interact with the user, you'll want to use Debconf. 34 35 TODO: Document Debconf usage 36 27 37 == Testing == 28 38