/usr/share/netcf/lenses/sysconfig.aug is in libnetcf1 0.1.9-2ubuntu3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | (* Variation of the Shellvars lens *)
(* Supports only what's needed to handle sysconfig files *)
(* Modified to strip quotes. In the put direction, add double quotes *)
(* around values that need them *)
(* To keep things simple, we also do not support shell variable arrays *)
module Sysconfig =
let eol = Util.eol
let key_re = /[A-Za-z0-9_]+(\[[0-9]+\])?/ - "unset" - "export"
let eq = Util.del_str "="
let comment = Util.comment
let empty = Util.empty
let xchgs = Build.xchgs
let dels = Util.del_str
let nothing = del /(""|'')?/ "" . value ""
(* Chars allowed in a bare string *)
let bchar = /[^ \t\n\"'\\]|\\\\./
let qchar = /["']/ (* " *)
(* We split the handling of right hand sides into a few cases:
* bare - strings that contain no spaces, optionally enclosed in
* single or double quotes
* dquot - strings that contain at least one space or apostrophe,
* which must be enclosed in double quotes
* squot - strings that contain an unescaped double quote
*)
let bare = del qchar? "" . store (bchar+) . del qchar? ""
let dquot =
del qchar "\"" . store (bchar* . /[ \t']/ . bchar*)+ . del qchar "\""
let squot =
dels "'" . store ((bchar|/[ \t]/)* . "\"" . (bchar|/[ \t]/)*)+ . dels "'"
let export = [ key "export" . Util.del_ws_spc ]
let kv (value:lens) = [ export? . key key_re . eq . value . eol ]
let assign = kv nothing | kv bare | kv dquot | kv squot
let var_action (name:string) =
[ xchgs name ("@" . name) . Util.del_ws_spc . store key_re . eol ]
let unset = var_action "unset"
let bare_export = var_action "export"
let source =
[
del /\.|source/ "." . label ".source" .
Util.del_ws_spc . store /[^= \t\n]+/ . eol
]
let lns = (comment | empty | source | assign | unset | bare_export) *
(*
Examples:
abc -> abc -> abc
"abc" -> abc -> abc
"a b" -> a b -> "a b"
'a"b' -> a"b -> 'a"b'
*)
|