From 671d347ce4895f426be61ffee9a016f4fd9af899 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Fri, 29 Nov 2013 18:20:23 -0500 Subject: parse_control(): Don't check for unknown fields. --- (limited to 'lib') diff --git a/lib/control.sh b/lib/control.sh index 9f76c67..ffa8bc7 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -31,8 +31,6 @@ parse_control() local field_cb="${2}" local paragraph_cb="${3}" local req_fields="${4}" - local opt_fields="${5}" - local all_fields= local in_paragraph= local line= local para_req_fields= @@ -43,10 +41,6 @@ parse_control() control_file="${1}" control_line_nr=0 - req_fields="$(printf '%s\n' ${req_fields})" - opt_fields="$(printf '%s\n' ${opt_fields})" - all_fields="${LF}${req_fields}${LF}${opt_fields}${LF}" - in_paragraph='false' while IFS='' read -r line; do @@ -69,7 +63,7 @@ parse_control() "${para_req_fields}" fi fi - para_req_fields="${req_fields}" + para_req_fields="$(printf '%s\n' ${req_fields})" got_fields="${LF}" name='' value='' @@ -92,19 +86,9 @@ parse_control() continue fi if [ "x${para_req_fields}" != 'x' ]; then - if [ "x${all_fields%${LF}${name}${LF}*}" = \ - "x${all_fields}" ]; then - # Unknown field. - parse_control_error \ - 'control_unknown_field' \ - "${name}" - else - # Remove field from list of required - # fields. - para_req_fields="$(printf '%s' \ - "${para_req_fields}" | \ - grep -Fv "${name}")" - fi + # Remove field from list of required fields. + para_req_fields="$(printf '%s' "${para_req_fields}" | \ + grep -Fv "${name}")" fi if [ "x${got_fields%${LF}${name}${LF}*}" != \ "x${got_fields}" ]; then -- cgit v0.9.1