3 Parses /etc/dpkg/dpkg.cfg
5 Author: Robin Lee Powell <rlpowell@digitalkingdom.org>
8 This file, and the attendant test_dpgk.aug, are explicitly
9 placed in the public domain.
12 dpkg.cfg is a simple list of options, the same ones as the
13 command line options, with or without a value.
15 The tree is a list of either comments or option/value pairs by
16 name. Use "set" to set an option with a value, and "clear" for a
23 augtool> ls /files/etc/dpkg/dpkg.cfg
24 #comment[1] = dpkg configuration file
25 #comment[2] = This file can contain default options for dpkg. All command-line
26 #comment[3] = options are allowed. Values can be specified by putting them after
27 #comment[4] = the option, separated by whitespace and/or an `=' sign.
28 #comment[5] = Do not enable debsig-verify by default; since the distribution is not using
29 #comment[6] = embedded signatures, debsig-verify would reject all packages.
31 #comment[7] = Log status changes and actions to a file.
32 log = /var/log/dpkg.log
33 augtool> get /files/etc/dpkg/dpkg.cfg/no-debsig
34 /files/etc/dpkg/dpkg.cfg/no-debsig (none)
35 augtool> get /files/etc/dpkg/dpkg.cfg/log
36 /files/etc/dpkg/dpkg.cfg/log = /var/log/dpkg.log
37 augtool> clear /files/etc/dpkg/dpkg.cfg/testopt
38 augtool> set /files/etc/dpkg/dpkg.cfg/testopt2 test
42 $ cat /etc/dpkg/dpkg.cfg.augnew
43 # dpkg configuration file
45 # This file can contain default options for dpkg. All command-line
46 # options are allowed. Values can be specified by putting them after
47 # the option, separated by whitespace and/or an `=' sign.
50 # Do not enable debsig-verify by default; since the distribution is not using
51 # embedded signatures, debsig-verify would reject all packages.
54 # Log status changes and actions to a file.
65 let sep_tab = Util.del_ws_tab
66 let sep_spc = Util.del_ws_spc
67 let eol = del /[ \t]*\n/ "\n"
69 let comment = Util.comment
70 let empty = Util.empty
72 let word = /[^,# \n\t]+/
73 let keyword = /[^,# \n\t\/]+/
76 Keyword, followed by optional whitespace and value, followed
79 The actual file specification doesn't require EOL, but the
80 likelihood of the file not having one is pretty slim, and
81 this way things we add have EOL.
84 let record = [ key keyword . (sep_spc . store word)? . eol ]
87 Any number of empty lines, comments, and records.
89 let lns = ( empty | comment | record ) *
91 let xfm = transform lns (incl "/etc/dpkg/dpkg.cfg")