Debian Codegraph @

doc/man/confmodule.3

raw
1 .TH CONFMODULE 3
2 .SH NAME
3 confmodule \- communicate with Debian configuration system FrontEnd.
4 .SH SYNOPSIS
5 #!/bin/sh -e
6 . /usr/share/debconf/confmodule
7 db_version 2.0
8 db_capb 'backup'
9 CAPB=$RET
10 db_input 'foo/bar' || true
11 db_go || true
12 .SH DESCRIPTION
13 This is a library of shell functions that eases communication with Debian's
14 configuration management system. It can communicate with a FrontEnd via the
15 debconf protocol. The design is that each command in the protocol is
16 represented by one function in this module. The functionname is the same as
17 the command, except it is prefixed with "db_" and is lower-case. Call
18 the function and pass in any parameters you want to follow the command. Any
19 textual return code from the FrontEnd will be returned to you in the $RET
20 variable, while the numeric return code from the FrontEnd will be returned
21 as a return code (and so those return codes must be captured or ignored).
22 .SH NOTES
23 Once this library is loaded, any text you later output will go to standard
24 error, rather than standard output. This is a good thing in general, because
25 text sent to standard output is interpreted by the FrontEnd as commands. If
26 you do want to send a command directly to the FrontEnd, you must output it
27 to file descriptor 3, like this:
28 echo GET foo/bar >&3
29 .P
30 The library checks to make sure it is actually speaking to a FrontEnd by
31 examining the DEBIAN_HAS_FRONTEND variable. If it is set, a FrontEnd is
32 assumed to be running. If not, the library turns into one, and runs a copy
33 of the script that loaded the library connected to it. This means that if you
34 source this library, you should do so very near to the top of your script,
35 because everything before the sourcing of the library may well be run again.
36 .SH SEE ALSO
37 .BR debconf-devel (7),
38 .BR dpkg-preconfigure (8),
39 .BR dpkg-reconfigure (8),
40 debconf_specification in the debian-policy package
41 .BR
42 .SH AUTHOR
43 Joey Hess <[email protected]>