diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/control.sh | 24 |
1 files changed, 4 insertions, 20 deletions
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 |