From: fredrik Date: Tue, 22 May 2007 00:50:29 +0000 (+0000) Subject: Make proper variable names in doldacond.conf.5. X-Git-Tag: 0.4~36 X-Git-Url: http://git.dolda2000.com/gitweb/?a=commitdiff_plain;h=aba46e776023b411cdf5f586a0ca81464a1cf319;p=doldaconnect.git Make proper variable names in doldacond.conf.5. git-svn-id: svn+ssh://svn.dolda2000.com/srv/svn/repos/src/doldaconnect@1042 959494ce-11ee-0310-bf91-de5d638817bd --- diff --git a/doc/man/Makefile.am b/doc/man/Makefile.am index 03fe72a..813f5b3 100644 --- a/doc/man/Makefile.am +++ b/doc/man/Makefile.am @@ -1,7 +1,7 @@ man_MANS = doldacond.conf.5 doldacond.8 BUILT_SOURCES = doldacond.conf.5 -doldacond.conf.5: doldacond.conf.5.in ../../daemon/*.c +doldacond.conf.5: doldacond.conf.5.in ../../daemon/*.c mkcvman ./mkcvman ../../daemon/*.c doldacond.conf.5 EXTRA_DIST = doldacond.conf.5.in mkcvman \ diff --git a/doc/man/mkcvman b/doc/man/mkcvman index aea3503..d2297bf 100755 --- a/doc/man/mkcvman +++ b/doc/man/mkcvman @@ -4,11 +4,15 @@ for $filename (@ARGV) { open(SRC, $filename) || die "$filename: $!"; $state = 0; delete @tvars{keys %tvars}; + $module = ""; while() { chomp; - if(/struct configvar/ && /\[\]/) { + if(($state == 0) && /struct configvar/ && /\[\]/) { $state = 1; } + if(($state == 0) && /struct module/ && /=/) { + $state = 3; + } if(($state == 1) && /^\s*\/\*\*/) { $curdoc = ""; $state = 2; @@ -47,13 +51,24 @@ for $filename (@ARGV) { } $curdoc .= $_; } + if(($state == 3) && /\.name\s*=\s*\"([^\"]+)\"/) { + $module = $1; + } + if(($state == 3) && /\s*\};$/) { + $state = 0; + } } close SRC; - $module = $filename; - $module =~ s/^.*\///; - $module =~ s/\..*$//; - for $var (keys %tvars) { - $vars{"$module.$var"} = $tvars{$var}; + #$module = $filename; + #$module =~ s/^.*\///; + #$module =~ s/\..*$//; + if($module eq "") { + print STDERR "$filename is not a module\n"; + } else { + print STDERR ("$filename is module $module and has " . scalar(keys %tvars) . " variables\n"); + for $var (keys %tvars) { + $vars{"$module.$var"} = $tvars{$var}; + } } }