Commit 1ddf657e authored by Nils Goroll's avatar Nils Goroll

parse multiple db files, include filenames and checksums in boilerplate

parent 9ffcf56a
...@@ -315,8 +315,8 @@ EOF ...@@ -315,8 +315,8 @@ EOF
$dbboilerplate =~ s/^\s*\*?/ */mog; $dbboilerplate =~ s/^\s*\*?/ */mog;
_VCL($out, VCL_TOP, <<'EOF'); _VCL($out, VCL_TOP, <<'EOF');
* the contents of this file have been generated from a database file which * the contents of this file have been generated from database files which
* included the following notice: * included the following notices:
* *
EOF EOF
_VCL($out, VCL_TOP, $dbboilerplate); _VCL($out, VCL_TOP, $dbboilerplate);
...@@ -605,11 +605,13 @@ GetOptions ('key=s' => \$opt{key}, ...@@ -605,11 +605,13 @@ GetOptions ('key=s' => \$opt{key},
# remaining arguments are db files # remaining arguments are db files
my @dbrefs; my @dbrefs;
my @dbnames;
my @dbchecksums; my @dbchecksums;
foreach my $f (@ARGV) { foreach my $f (@ARGV) {
my ($dbref, $dbchecksum) = load_classifier_db($f, $opt{key}); my ($dbref, $dbchecksum) = load_classifier_db($f, $opt{key});
push @dbrefs, ($dbref); push @dbrefs, ($dbref);
push @dbnames, ($f);
push @dbchecksums, ($dbchecksum); push @dbchecksums, ($dbchecksum);
} }
...@@ -703,8 +705,18 @@ my %special_entries; ...@@ -703,8 +705,18 @@ my %special_entries;
## build @entries, except that not all fields are filled ## build @entries, except that not all fields are filled
my %subkeys_count; my %subkeys_count;
my $dbchecksum = join(", ", @dbchecksums); my $dbchecksum = join(", ", @dbchecksums);
my $dbboilerplate = "checksum ".$dbchecksum."\n"; my $dbboilerplate = " ** checksums ".$dbchecksum."\n *\n";
foreach (split(/[\n\r\f]/, ${$dbrefs[0]})) {
for (my $i = 0; $i <= $#dbrefs; $i++) {
my $dbref = $dbrefs[$i];
$dbboilerplate .=
" *\n".
" ******\n".
' ** file '.$dbnames[$i].
' checksum '.$dbchecksums[$i]."\n";
foreach (split(/[\n\r\f]/, $$dbref)) {
if (/^\s*#/) { if (/^\s*#/) {
$dbboilerplate .= $_."\n"; $dbboilerplate .= $_."\n";
next; next;
...@@ -745,6 +757,7 @@ foreach (split(/[\n\r\f]/, ${$dbrefs[0]})) { ...@@ -745,6 +757,7 @@ foreach (split(/[\n\r\f]/, ${$dbrefs[0]})) {
$e[ENTRY_SUBKEYS] = \@sks; $e[ENTRY_SUBKEYS] = \@sks;
$e[ENTRY_INITMASK] = 0; $e[ENTRY_INITMASK] = 0;
$entries[$line++] = \@e; $entries[$line++] = \@e;
}
} }
# value is bitmask # value is bitmask
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment