From 2320bb94c426ed16b6f9623d06f151ac811d50bd Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 31 Jul 2012 22:24:30 -0400 Subject: Make oh-parsechangelog use locale library. --- (limited to 'src') diff --git a/src/oh-parsechangelog.sh b/src/oh-parsechangelog.sh index 1b72ce3..9935d8b 100644 --- a/src/oh-parsechangelog.sh +++ b/src/oh-parsechangelog.sh @@ -19,27 +19,33 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -. @@LIBDIR@@/opkhelper/changelog - -print_usage() -{ - printf 'Usage: %s\n' "${1}" -} +. @@LIBDIR@@/messages +. @@LIBDIR@@/locale +. @@LIBDIR@@/changelog main() { - oh_changelog_parse changelog output + oh_locale_set - return 0 + if [ "${#}" -ne 0 ]; then + oh_usage + exit 1 + fi + + oh_changelog_parse changelog output } output() { + # These strings are machine-readable output and should not be localized or + # printed with oh_info(). + printf 'Source: %s\nVersion: %s\nDistribution: %s\n' \ "${OH_CHANGELOG_SOURCE}" "${OH_CHANGELOG_VERSION}" \ "${OH_CHANGELOG_DISTRIBUTION}" printf 'Maintainer: %s\nDate: %s\n' \ "${OH_CHANGELOG_MAINTAINER}" "${OH_CHANGELOG_DATE}" + printf 'Changes:\n' while IFS= read -r line; do if [ -z "${line}" ]; then @@ -54,4 +60,4 @@ EOF return 1 } -main +main "${@}" -- cgit v0.9.1