summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2012-07-31 22:24:30 (EDT)
committer P. J. McDermott <pjm@nac.net>2012-07-31 22:26:07 (EDT)
commit2320bb94c426ed16b6f9623d06f151ac811d50bd (patch)
tree69ad37dfac26aa6ce48d2319a1bd859a12e2f225 /src
parentc707416166cba430d1db4f568def3ceae58070db (diff)
Make oh-parsechangelog use locale library.
Diffstat (limited to 'src')
-rw-r--r--src/oh-parsechangelog.sh24
1 files changed, 15 insertions, 9 deletions
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 <http://www.gnu.org/licenses/>.
-. @@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 "${@}"