From e8e7840e41680aca9f78166dd2a0463555d6d2ee Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 14 Jul 2013 17:03:25 -0400 Subject: include: Collect some fields. --- (limited to 'lib/cmd/include.sh') 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 } -- cgit v0.9.1