diff options
author | P. J. McDermott <pjm@nac.net> | 2013-07-14 17:03:25 (EDT) |
---|---|---|
committer | P. J. McDermott <pjm@nac.net> | 2013-07-14 17:03:25 (EDT) |
commit | e8e7840e41680aca9f78166dd2a0463555d6d2ee (patch) | |
tree | c20cac7d365aea9077185e6c13fb02305bd0f1ee /lib/cmd | |
parent | 38093c7e6c3ff98de7b00ef390c491e6716940cb (diff) |
include: Collect some fields.
Diffstat (limited to 'lib/cmd')
-rw-r--r-- | lib/cmd/include.sh | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/lib/cmd/include.sh b/lib/cmd/include.sh index 4d1e8c5..4730255 100644 --- a/lib/cmd/include.sh +++ b/lib/cmd/include.sh @@ -19,13 +19,24 @@ use control +CMD_INCLUDE_CHANGES_FIELDS='Package Source Version Architecture Platform +Distribution Maintainer Changed-By Date Changes Filename' + +cmd_include_package= +cmd_include_distribution= +cmd_include_filename= + cmd_include_main() { local changes for changes in "${@}"; do - parse_control "${changes}" cmd_include_changes_field '' '' + parse_control "${changes}" cmd_include_changes_field \ + "${CMD_INCLUDE_CHANGES_FIELDS}" '' done + + printf 'Including %s into %s: %s\n' "${cmd_include_package}" \ + "${cmd_include_distribution}" "${cmd_include_filename}" } cmd_include_changes_field() @@ -33,8 +44,15 @@ cmd_include_changes_field() local name="${1}" local value="${2}" - printf '%s:' "${name}" - IFS="${LF}" - printf ' %s\n' ${value} - unset IFS + case "${name}" in + 'Package') + cmd_include_package="${value}" + ;; + 'Distribution') + cmd_include_distribution="${value}" + ;; + 'Filename') + cmd_include_filename="${value}" + ;; + esac } |