From 63fa875896f8fc883580062180636c9f3b780330 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Tue, 24 Apr 2012 19:33:27 -0400 Subject: Make oh-* tools consistently use message library. --- (limited to 'src/oh-gencontrol.sh') diff --git a/src/oh-gencontrol.sh b/src/oh-gencontrol.sh index 207240f..4cc48e5 100644 --- a/src/oh-gencontrol.sh +++ b/src/oh-gencontrol.sh @@ -21,6 +21,7 @@ . @@LIBDIR@@/opkhelper/controlfields . @@LIBDIR@@/opkhelper/architecture +. @@LIBDIR@@/opkhelper/messages print_usage() { @@ -29,15 +30,12 @@ print_usage() missing_field() { - printf 'oh-gencontrol: Error: Missing field "%s" in control file.\n' \ - "${1}" >&2 - exit 2 + oh_error 'Missing field "%s" in control file' "${1}" } invalid_pkg_name() { - printf 'oh-gencontrol: Error: Invalid package name: "%s"\n' "${1}" >&2 - exit 2 + oh_error 'Invalid package name: "%s"' "${1}" } copy_required_field() @@ -67,8 +65,7 @@ gen_control_src() srcpkg=$(oh_get_field Source) || missing_field Source oh_validate_pkg_name "${srcpkg}" || invalid_pkg_name "${srcpkg}" - printf 'oh-gencontrol: Generating control directory for package "%s"...\n' \ - "${srcpkg}-src" + oh_info 'Generating control directory for package "%s"...' "${srcpkg}-src" control_dir="${srcpkg}-src.control" control="${control_dir}/control" @@ -92,8 +89,7 @@ gen_control_bin() binpkg="${1}" oh_validate_pkg_name "${binpkg}" || invalid_pkg_name "${binpkg}" - printf 'oh-gencontrol: Generating control directory for package "%s"...\n' \ - "${binpkg}" + oh_info 'Generating control directory for package "%s"...' "${binpkg}" data_dir="${binpkg}.data" control_dir="${binpkg}.control" -- cgit v0.9.1