diff options
Diffstat (limited to 'lib/changelog.sh')
-rw-r--r-- | lib/changelog.sh | 26 |
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/changelog.sh b/lib/changelog.sh index 7cb6c0b..3216f94 100644 --- a/lib/changelog.sh +++ b/lib/changelog.sh @@ -19,16 +19,12 @@ _ob_parse_changelog_error() { - local file= - local line_nr= - local msg_id= + local file="${1}" + local line_nr="${2}" + local msg_id="${3}" + shift 3 || _ob_abort local file_info= - file="${1}" - line_nr="${2}" - msg_id="${3}" - shift 3 - file_info="$(printf '%20s(l%d)' "${file}" "${line_nr}")" _ob_warn_msg "${msg_id}" "${file_info}" "${@}" @@ -57,15 +53,16 @@ _ob_get_changelog_expect_str() ## \fIchangelog\fP file or when \fIentry_cb\fP returns non-zero. ## @operand file req The file to parse, or "-" for standard input. ## @operand entry_cb req Callback to run for each entry. -## @return Returns 0 after parsing, or 125 on missing arguments. +## @return Returns 0 after parsing. ## @stderr Prints error messages on parse errors. ## @pure maybe This function has no side effects. Whether this function is ## subshell-safe in practice depends on whether \fIentry_cb\fP is ## subshell-safe. ob_parse_changelog() { - local file= - local entry_cb= + local file="${1}" + local entry_cb="${2}" + shift 2 || _ob_abort local line_nr= local line= local line_= @@ -78,13 +75,6 @@ ob_parse_changelog() local maintainer= local date= - if [ ${#} -eq 2 ]; then - file="${1}" - entry_cb="${2}" - else - return 125 - fi - # Parsing logic based on that of dpkg. line_nr=0 |