From 0d3165e0b79d94df943c2f1a08e23e085e76c241 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 30 Sep 2012 16:19:20 -0400 Subject: Use metadata functions in ob_parse_changelog(). --- (limited to 'lib') diff --git a/lib/changelog.sh b/lib/changelog.sh index dedfa9a..c1b3748 100644 --- a/lib/changelog.sh +++ b/lib/changelog.sh @@ -22,16 +22,7 @@ _OB_CHANGELOG_SM='true' ob_use messages ob_use locale - -# Constant global parameters: -# FIXME: Remove. -OB_SOURCE_RE='^[a-z0-9][a-z0-9+.-]+$' -OB_SOURCE_VERSION_ID_RE='^' -OB_SOURCE_VERSION_ID_RE="${OB_SOURCE_VERSION_ID_RE}"'[0-9a-z.~]+' -OB_SOURCE_VERSION_ID_RE="${OB_SOURCE_VERSION_ID_RE}"'(\+sip[1-9][0-9]*)?' -OB_SOURCE_VERSION_ID_RE="${OB_SOURCE_VERSION_ID_RE}"'(-[1-9][0-9]*)?' -OB_SOURCE_VERSION_ID_RE="${OB_SOURCE_VERSION_ID_RE}"'(\+[a-z0-9]+-[1-9][0-9]*)?' -OB_SOURCE_VERSION_ID_RE="${OB_SOURCE_VERSION_ID_RE}"'$' +ob_use metadata OB_CHANGELOG_SOURCE= OB_CHANGELOG_VERSION= @@ -100,15 +91,11 @@ ${_obpch_line}" OB_CHANGELOG_DISTRIBUTION= OB_CHANGELOG_CHANGES= else - echo "${_obpch_source}" | \ - grep -E "${OB_SOURCE_RE}" >/dev/null 2>&1 - if [ ${?} -ne 0 ]; then + if ! ob_validate_source_name "${_obpch_source}"; then _ob_parse_changelog_error "${_obpch_line_nr}" \ 'changelog_bad_source' "${source}" fi - echo "${_obpch_version}" | \ - grep -E "${OB_SOURCE_VERSION_ID_RE}" >/dev/null 2>&1 - if [ ${?} -ne 0 ]; then + if ! ob_parse_version "${_obpch_version}"; then _ob_parse_changelog_error "${_obpch_line_nr}" \ 'changelog_bad_source_version' "${_obpch_version}" fi -- cgit v0.9.1