From 267ed50dc7d218db7d5e7f6dcbb1727f3062c32f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Thu, 28 Aug 2014 14:12:28 -0700 Subject: [PATCH] Allow unknown field attributes in record.dbd files They will be noisy, but are retained in regenerated output and won't stop the build from proceeding. --- src/tools/DBD/Recfield.pm | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/tools/DBD/Recfield.pm b/src/tools/DBD/Recfield.pm index b0bc7af56..a370b2cc7 100644 --- a/src/tools/DBD/Recfield.pm +++ b/src/tools/DBD/Recfield.pm @@ -76,11 +76,15 @@ sub add_attribute { my ($this, $attr, $value) = @_; unquote $value; my $match = $field_attrs{$attr}; - dieContext("Unknown field attribute '$1', valid attributes are:", - sort keys %field_attrs) - unless defined $match; - dieContext("Bad value '$value' for field '$attr' attribute") - unless $value =~ m/$match/; + if (defined $match) { + dieContext("Bad value '$value' for field attribute '$attr'") + unless $value =~ m/$match/; + } + else { + warnContext("Unknown field attribute '$attr' with value '$value'; " . + "known attributes are:", + join(", ", sort keys %field_attrs)); + } $this->{ATTR_INDEX}->{$attr} = $value; }