From 1bd1f57312bc110d487aa4d3ce09842816bbaf99 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 01 Aug 2012 04:59:20 -0400 Subject: Hardcode relative path to changelog. --- diff --git a/lib/changelog.sh b/lib/changelog.sh index 53cca58..909c955 100644 --- a/lib/changelog.sh +++ b/lib/changelog.sh @@ -23,6 +23,7 @@ _OH_CHANGELOG_SH=true . @@LIBDIR@@/messages +. @@LIBDIR@@/util # Constant global parameters: OH_SOURCE_RE='^[a-z0-9][a-z0-9+.-]+$' @@ -35,7 +36,6 @@ OH_SOURCE_VERSION_ID_RE="${OH_SOURCE_VERSION_ID_RE}"'$' oh_changelog_parse_error() { - _file="${1}" _line_nr="${2}" _error="${3}" _expect_id="${4}" @@ -48,7 +48,7 @@ oh_changelog_parse_error() *) _expect_str='unknown';; esac - _file_info=$(printf '%20s(l%d):' "${_file}" "${_line_nr}") + _file_info=$(printf '%20s(l%d):' "${OH_SOURCE_DIR}/changelog" "${_line_nr}") oh_warn "${_file_info} ${_error}" "${_expect_str}" } @@ -56,8 +56,7 @@ oh_changelog_parse() { # Parsing logic based on that of dpkg. - _file="${1}" - _cb="${2}" + _cb="${1}" _expect=FIRST_HEADING _line_nr=0 @@ -72,7 +71,7 @@ ${_line}" elif [ "${_expect}" = NEXT_OR_EOF ]; then : elif [ "${_expect}" != CHANGES_OR_TRAILER ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_found_blank_line}" "${_expect}" else _blank_lines="${_blank_lines} @@ -81,7 +80,7 @@ ${_line}" elif [ "${_line# }" = "${_line}" ]; then if [ "${_expect}" != FIRST_HEADING -a \ "${_expect}" != NEXT_OR_EOF ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_found_heading}" "${_expect}" fi _source="${_line%% (*}" @@ -92,7 +91,7 @@ ${_line}" if [ -z "${_source}" -o -z "${_distribution}" -o \ -z "${_version}" -o \ "${_version% *}" != "${_version}" ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_bad_heading}" OH_CHANGELOG_SOURCE= OH_CHANGELOG_VERSION= @@ -102,13 +101,13 @@ ${_line}" echo "${_source}" | \ grep -E "${OH_SOURCE_RE}" >/dev/null 2>&1 if [ "${?}" -ne 0 ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_bad_source}" fi echo "${_version}" | \ grep -E "${OH_SOURCE_VERSION_ID_RE}" >/dev/null 2>&1 if [ "${?}" -ne 0 ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_bad_source_version}" fi OH_CHANGELOG_SOURCE="${_source}" @@ -120,7 +119,7 @@ ${_line}" _blank_lines= elif [ "${_line# -- }" != "${_line}" ]; then if [ "${_expect}" != CHANGES_OR_TRAILER ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_found_trailer}" "${_expect}" fi _line="${_line# -- }" @@ -128,7 +127,7 @@ ${_line}" _date="${_line#* }" if [ -z "${_maintainer}" -o -z "${_date}" -o \ "${_maintainer}" = "${_date}" ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_bad_trailer}" OH_CHANGELOG_MAINTAINER= OH_CHANGELOG_DATE= @@ -142,12 +141,12 @@ ${_line}" _expect=NEXT_OR_EOF _blank_lines= elif [ "${_line# --}" != "${_line}" ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_bad_trailer}" elif [ "${_line## }" != "${_line}" ]; then if [ "${_expect}" != START_CHANGES -a \ "${_expect}" != CHANGES_OR_TRAILER ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_found_change}" "${_expect}" fi OH_CHANGELOG_CHANGES="${OH_CHANGELOG_CHANGES} @@ -155,14 +154,14 @@ ${_blank_lines}${_line}" _expect=CHANGES_OR_TRAILER _blank_lines= else - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_bad_line}" _blank_lines= fi - done <"${_file}" + done <"${OH_SOURCE_DIR}/changelog" if [ "${_expect}" != NEXT_OR_EOF ]; then - oh_changelog_parse_error "${_file}" "${_line_nr}" \ + oh_changelog_parse_error "${_line_nr}" \ "${oh_str_changelog_found_eof}" "${_expect}" fi diff --git a/man/oh_changelog_parse.3.in b/man/oh_changelog_parse.3.in index e6559a6..38a15f2 100644 --- a/man/oh_changelog_parse.3.in +++ b/man/oh_changelog_parse.3.in @@ -7,7 +7,6 @@ oh_changelog_parse - parse a changelog file .B . @@LIBDIR@@/changelog .P .B oh_changelog_parse -.I file .I cb .SH DESCRIPTION diff --git a/src/oh-parsechangelog.sh b/src/oh-parsechangelog.sh index 766a872..7cca14d 100644 --- a/src/oh-parsechangelog.sh +++ b/src/oh-parsechangelog.sh @@ -33,7 +33,7 @@ main() exit 1 fi - oh_changelog_parse changelog output + oh_changelog_parse output } output() diff --git a/src/opkbuild.sh b/src/opkbuild.sh index ff374d4..f9dbeb2 100644 --- a/src/opkbuild.sh +++ b/src/opkbuild.sh @@ -78,7 +78,7 @@ main() test_uid0_cmd find_sanity - oh_changelog_parse changelog setup_package + oh_changelog_parse setup_package if [ "${OPT_BUILD}" = 'source' -o "${OPT_BUILD}" = 'full' ]; then build_source -- cgit v0.9.1