|
Packit Service |
a2ae7a |
(*
|
|
Packit Service |
a2ae7a |
Module: Dpkg
|
|
Packit Service |
a2ae7a |
Parses /etc/dpkg/dpkg.cfg
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
Author: Robin Lee Powell <rlpowell@digitalkingdom.org>
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: License
|
|
Packit Service |
a2ae7a |
This file, and the attendant test_dpgk.aug, are explicitly
|
|
Packit Service |
a2ae7a |
placed in the public domain.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Description
|
|
Packit Service |
a2ae7a |
dpkg.cfg is a simple list of options, the same ones as the
|
|
Packit Service |
a2ae7a |
command line options, with or without a value.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
The tree is a list of either comments or option/value pairs by
|
|
Packit Service |
a2ae7a |
name. Use "set" to set an option with a value, and "clear" for a
|
|
Packit Service |
a2ae7a |
bare option.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
About: Usage Example
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(start code)
|
|
Packit Service |
a2ae7a |
$ augtool -n
|
|
Packit Service |
a2ae7a |
augtool> ls /files/etc/dpkg/dpkg.cfg
|
|
Packit Service |
a2ae7a |
#comment[1] = dpkg configuration file
|
|
Packit Service |
a2ae7a |
#comment[2] = This file can contain default options for dpkg. All command-line
|
|
Packit Service |
a2ae7a |
#comment[3] = options are allowed. Values can be specified by putting them after
|
|
Packit Service |
a2ae7a |
#comment[4] = the option, separated by whitespace and/or an `=' sign.
|
|
Packit Service |
a2ae7a |
#comment[5] = Do not enable debsig-verify by default; since the distribution is not using
|
|
Packit Service |
a2ae7a |
#comment[6] = embedded signatures, debsig-verify would reject all packages.
|
|
Packit Service |
a2ae7a |
no-debsig = (none)
|
|
Packit Service |
a2ae7a |
#comment[7] = Log status changes and actions to a file.
|
|
Packit Service |
a2ae7a |
log = /var/log/dpkg.log
|
|
Packit Service |
a2ae7a |
augtool> get /files/etc/dpkg/dpkg.cfg/no-debsig
|
|
Packit Service |
a2ae7a |
/files/etc/dpkg/dpkg.cfg/no-debsig (none)
|
|
Packit Service |
a2ae7a |
augtool> get /files/etc/dpkg/dpkg.cfg/log
|
|
Packit Service |
a2ae7a |
/files/etc/dpkg/dpkg.cfg/log = /var/log/dpkg.log
|
|
Packit Service |
a2ae7a |
augtool> clear /files/etc/dpkg/dpkg.cfg/testopt
|
|
Packit Service |
a2ae7a |
augtool> set /files/etc/dpkg/dpkg.cfg/testopt2 test
|
|
Packit Service |
a2ae7a |
augtool> save
|
|
Packit Service |
a2ae7a |
Saved 1 file(s)
|
|
Packit Service |
a2ae7a |
augtool>
|
|
Packit Service |
a2ae7a |
$ cat /etc/dpkg/dpkg.cfg.augnew
|
|
Packit Service |
a2ae7a |
# dpkg configuration file
|
|
Packit Service |
a2ae7a |
#
|
|
Packit Service |
a2ae7a |
# This file can contain default options for dpkg. All command-line
|
|
Packit Service |
a2ae7a |
# options are allowed. Values can be specified by putting them after
|
|
Packit Service |
a2ae7a |
# the option, separated by whitespace and/or an `=' sign.
|
|
Packit Service |
a2ae7a |
#
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# Do not enable debsig-verify by default; since the distribution is not using
|
|
Packit Service |
a2ae7a |
# embedded signatures, debsig-verify would reject all packages.
|
|
Packit Service |
a2ae7a |
no-debsig
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
# Log status changes and actions to a file.
|
|
Packit Service |
a2ae7a |
log /var/log/dpkg.log
|
|
Packit Service |
a2ae7a |
testopt
|
|
Packit Service |
a2ae7a |
testopt2 test
|
|
Packit Service |
a2ae7a |
(end code)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
module Dpkg =
|
|
Packit Service |
a2ae7a |
autoload xfm
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let sep_tab = Util.del_ws_tab
|
|
Packit Service |
a2ae7a |
let sep_spc = Util.del_ws_spc
|
|
Packit Service |
a2ae7a |
let eol = del /[ \t]*\n/ "\n"
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let comment = Util.comment
|
|
Packit Service |
a2ae7a |
let empty = Util.empty
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let word = /[^,# \n\t]+/
|
|
Packit Service |
a2ae7a |
let keyword = /[^,# \n\t\/]+/
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: record
|
|
Packit Service |
a2ae7a |
Keyword, followed by optional whitespace and value, followed
|
|
Packit Service |
a2ae7a |
by EOL.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
The actual file specification doesn't require EOL, but the
|
|
Packit Service |
a2ae7a |
likelihood of the file not having one is pretty slim, and
|
|
Packit Service |
a2ae7a |
this way things we add have EOL.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let record = [ key keyword . (sep_spc . store word)? . eol ]
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
(* View: lns
|
|
Packit Service |
a2ae7a |
Any number of empty lines, comments, and records.
|
|
Packit Service |
a2ae7a |
*)
|
|
Packit Service |
a2ae7a |
let lns = ( empty | comment | record ) *
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
let xfm = transform lns (incl "/etc/dpkg/dpkg.cfg")
|