diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2018-12-25 22:41:19 (EST) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2018-12-25 22:41:19 (EST) |
commit | 8d5bfc4679824ca505f5982ee602e5b79774f890 (patch) | |
tree | 6503e59fb9c27431cc5ae6ef738cf1c766b58611 /lib/control.sh | |
parent | 83463846ac7c239bf8dbd35f077cd4194d50323f (diff) |
libopkbuild: Move function definitions before points of use
Diffstat (limited to 'lib/control.sh')
-rw-r--r-- | lib/control.sh | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/lib/control.sh b/lib/control.sh index 157a677..40a9b08 100644 --- a/lib/control.sh +++ b/lib/control.sh @@ -22,6 +22,35 @@ _OB_SUBSTVARS_MAX_DEPTH=50 OB_CONTROL_NAME= OB_CONTROL_VALUE= +_ob_parse_control_error() +{ + local file= + local line_nr= + local msg_id= + local file_info= + local orig_text_domain= + + file="${1}" + line_nr="${2}" + msg_id="${3}" + shift 3 + + if [ ${line_nr} -eq 0 ]; then + file_info="$(printf '%20s:' "${file}")" + else + file_info="$(printf '%20s(l%d):' "${file}" "${line_nr}")" + fi + + 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}" + + return 0 +} + ob_parse_control() { local file= @@ -235,32 +264,3 @@ ob_substvars() return 0 } - -_ob_parse_control_error() -{ - local file= - local line_nr= - local msg_id= - local file_info= - local orig_text_domain= - - file="${1}" - line_nr="${2}" - msg_id="${3}" - shift 3 - - if [ ${line_nr} -eq 0 ]; then - file_info="$(printf '%20s:' "${file}")" - else - file_info="$(printf '%20s(l%d):' "${file}" "${line_nr}")" - fi - - 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}" - - return 0 -} |