Commit 31333ebb authored by Nils Goroll's avatar Nils Goroll

remove duplicate entries also without explicit fixup

parent 2c1aaa3d
......@@ -750,8 +750,8 @@ my %common_subkeys;
my $invalid = "*invalid*";
my $manual_fixup = "*manual fixup*";
sub fixup_entry($) {
my $entry = $_;
sub fixup_entry($$) {
my ($entry, $seen) = @_;
my $key = ${$entry->[ENTRY_KEY]};
......@@ -784,7 +784,12 @@ sub fixup_entry($) {
warn 'reordered from fixup: id '.$entry->[ENTRY_ID].' order '.$entry->[ENTRY_ORDER];
}
$entry->[ENTRY_ACTIVE] = 1;
if (exists($seen->{$key})) {
warn 'duplicate key '.$key.' - disabling';
} else {
$seen->{$key} = 1;
$entry->[ENTRY_ACTIVE] = 1;
}
}
sub process_entry($) {
......@@ -851,7 +856,10 @@ sub process_entry($) {
$entry->[ENTRY_INITMASK] = $initmask;
}
map { fixup_entry($_); } @entries;
{
my %fixup_seen;
map { fixup_entry($_, \%fixup_seen); } @entries;
}
@entries = sort { $a->[ENTRY_ORDER] <=> $b->[ENTRY_ORDER] }
grep { $_->[ENTRY_ACTIVE] } @entries;
......
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