summaryrefslogtreecommitdiffstats
path: root/src/oh-gencontrol.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/oh-gencontrol.sh')
-rw-r--r--src/oh-gencontrol.sh14
1 files changed, 5 insertions, 9 deletions
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"