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
$dbboilerplate =~ s/^\s*\*?/ */mog;
_VCL($out, VCL_TOP, <<'EOF');
* the contents of this file have been generated from a database file which
* included the following notice:
* the contents of this file have been generated from database files which
* included the following notices:
*
EOF
_VCL($out, VCL_TOP, $dbboilerplate);
......@@ -605,11 +605,13 @@ GetOptions ('key=s' => \$opt{key},
# remaining arguments are db files
my @dbrefs;
my @dbnames;
my @dbchecksums;
foreach my $f (@ARGV) {
my ($dbref, $dbchecksum) = load_classifier_db($f, $opt{key});
push @dbrefs, ($dbref);
push @dbnames, ($f);
push @dbchecksums, ($dbchecksum);
}
......@@ -703,8 +705,18 @@ my %special_entries;
## build @entries, except that not all fields are filled
my %subkeys_count;
my $dbchecksum = join(", ", @dbchecksums);
my $dbboilerplate = "checksum ".$dbchecksum."\n";
foreach (split(/[\n\r\f]/, ${$dbrefs[0]})) {
my $dbboilerplate = " ** checksums ".$dbchecksum."\n *\n";
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*#/) {
$dbboilerplate .= $_."\n";
next;
......@@ -745,6 +757,7 @@ foreach (split(/[\n\r\f]/, ${$dbrefs[0]})) {
$e[ENTRY_SUBKEYS] = \@sks;
$e[ENTRY_INITMASK] = 0;
$entries[$line++] = \@e;
}
}
# 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