summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-04-13 22:52:26 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-04-13 22:52:26 (EDT)
commit95a9b30c37392a0a9065be697ee5e8923129a92e (patch)
tree805e5fc29a0508d10337d3944d82229e70875f91
parent1caa11ae6d00d41a6fd45110c9aa463673f953b7 (diff)
include_changes(): Exit on missing changes fields
-rw-r--r--locale/en_US.sh1
-rw-r--r--src/include.sh6
2 files changed, 5 insertions, 2 deletions
diff --git a/locale/en_US.sh b/locale/en_US.sh
index 3922e4a..bd5e03f 100644
--- a/locale/en_US.sh
+++ b/locale/en_US.sh
@@ -54,6 +54,7 @@ msg_pro_archman_cmd_include_summary='include packages described in changes files
msg_pro_archman_cmd_include_usage='<changes> ...'
# src/include.sh
+msg_pro_archman_include_invalid_changes='Invalid changes file "%s"'
msg_pro_archman_include_unknown_changes_format='%s: Unknown format "%s"'
msg_pro_archman_include_including='Including %s (%s) into %s/%s...'
msg_pro_archman_include_no_files='No package files to include'
diff --git a/src/include.sh b/src/include.sh
index 1da053b..72d14f7 100644
--- a/src/include.sh
+++ b/src/include.sh
@@ -75,8 +75,10 @@ include_changes()
local pkg=
local pool_file=
- parse_control "${changes}" _include_changes_field \
- "${_INCLUDE_CHANGES_FIELDS}" ''
+ if ! parse_control "${changes}" _include_changes_field \
+ "${_INCLUDE_CHANGES_FIELDS}" ''; then
+ error 2 "$(get_msg 'include_invalid_changes')" "${changes}"
+ fi
if [ "x${_include_format}" != 'x1.0' ]; then
error 2 "$(get_msg 'include_unknown_changes_format')" \
"${changes}" "${_include_format}"