3 # Extract parameter definitions from the sample-mumble.cf files in
4 # order to build the postconf raw data file from which everything
9 # Suck in the parameter definition text. Skip non-parameter blocks.
10 # Strip all but the body text (i.e. strip off the non-comment line
11 # that shows the default, since we will use postconf output to supply
16 if ($param_name && $saved_text) {
17 $saved_text =~ s/^(\n|#|\s)+//;
18 $saved_text =~ s/(\n|#|\s)+$//;
19 $saved_text =~ s/^# ?/\n/;
20 $saved_text =~ s/\n# ?/\n/g;
21 $definition{$param_name} = $saved_text;
22 $param_name = $saved_text = "";
26 if (/^#/ && $param_name) {
30 if (/^# The (\S+) (configuration )?parameter/) {
36 # Read all the default parameter values. This also provides us with
37 # a list of all the parameters that postconf knows about.
39 open(POSTCONF
, "$POSTCONF -d|") || die "cannot run $POSTCONF: !$\n";
42 if (($name, $value) = split(/\s+=\s+/, $_, 2)) {
43 $defaults{$name} = $value;
45 warn "unexpected $POSTCONF output: $_\n";
48 close(POSTCONF
) || die "$POSTCONF failed: $!\n";
50 # Print all parameter definition text that we found, and warn about
51 # missing definition text.
53 for $param_name (sort keys %defaults) {
54 if (defined($definition{$param_name})) {
55 print "#DEFINE $param_name\n\n";
56 print $definition{$param_name};
59 warn "No definition found for $param_name\n";