summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-11-29 18:20:23 (EST)
committer P. J. McDermott <pjm@nac.net>2013-11-29 18:20:23 (EST)
commit671d347ce4895f426be61ffee9a016f4fd9af899 (patch)
tree02fa26e737ad083fd270d2277981fe7a7036bc09
parent9c84a8b630df472bed071f548c51cff62b14d396 (diff)
parse_control(): Don't check for unknown fields.
-rw-r--r--lib/control.sh24
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