summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-03-12 00:08:48 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-03-12 00:08:48 (EDT)
commit71125c6f8e6c55e38a1b4be70c9d181de9ad358d (patch)
tree2f860d1e1f8523dfcd661cacebff21a8593a91ef
parentf0c37c2b1e6ac6b3373b62e484bd4e6f8f8d441c (diff)
_ob_parse_control_error(): Use _ob_warn_msg()
-rw-r--r--lib/control.sh15
-rw-r--r--locale/en_US/libopkbuild_2.sh12
2 files changed, 9 insertions, 18 deletions
diff --git a/lib/control.sh b/lib/control.sh
index 727fafa..9e8bb71 100644
--- a/lib/control.sh
+++ b/lib/control.sh
@@ -25,7 +25,6 @@ _ob_parse_control_error()
local line_nr=
local msg_id=
local file_info=
- local orig_text_domain=
file="${1}"
line_nr="${2}"
@@ -33,20 +32,12 @@ _ob_parse_control_error()
shift 3
if [ ${line_nr} -eq 0 ]; then
- file_info="$(printf '%20s:' "${file}")"
+ file_info="$(printf '%20s' "${file}")"
else
- file_info="$(printf '%20s(l%d):' "${file}" "${line_nr}")"
+ file_info="$(printf '%20s(l%d)' "${file}" "${line_nr}")"
fi
- # TODO: Use _ob_warn_msg(), add "%s: " prefix to locale messages, and
- # drop ":" from file_info above.
-
- orig_text_domain="$(ob_get_text_domain)"
- ob_set_text_domain "${_OB_INTERNAL_TEXT_DOMAIN}"
-
- ob_warn "${file_info} $(ob_get_msg "${msg_id}")" "${@}"
-
- ob_set_text_domain "${orig_text_domain}"
+ _ob_warn_msg "${msg_id}" "${file_info}" "${@}"
return 0
}
diff --git a/locale/en_US/libopkbuild_2.sh b/locale/en_US/libopkbuild_2.sh
index b0570fe..f4ae464 100644
--- a/locale/en_US/libopkbuild_2.sh
+++ b/locale/en_US/libopkbuild_2.sh
@@ -23,13 +23,13 @@ msg_libopkbuild_2_bad_binary_name='Bad binary package name: "%s"'
msg_libopkbuild_2_duplicate_clean_binary_name='Duplicate clean binary package name: "%s"'
# lib/control.sh
-msg_libopkbuild_2_control_empty_line='empty line'
-msg_libopkbuild_2_control_bad_nv='badly formatted control field'
-msg_libopkbuild_2_control_unknown_field='unrecognized field "%s"'
-msg_libopkbuild_2_control_duplicate_field='duplicate field "%s"'
-msg_libopkbuild_2_control_found_contination='found continuation line where expected start of field'
+msg_libopkbuild_2_control_empty_line='%s: empty line'
+msg_libopkbuild_2_control_bad_nv='%s: badly formatted control field'
+msg_libopkbuild_2_control_unknown_field='%s: unrecognized field "%s"'
+msg_libopkbuild_2_control_duplicate_field='%s: duplicate field "%s"'
+msg_libopkbuild_2_control_found_contination='%s: found continuation line where expected start of field'
msg_libopkbuild_2_list_item_separator=', '
-msg_libopkbuild_2_control_missing_fields='missing fields: %s'
+msg_libopkbuild_2_control_missing_fields='%s: missing fields: %s'
msg_libopkbuild_2_substvar_deep_nesting='Possible recursion in substitutions'
# lib/changelog.sh