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-installdocs.sh') diff --git a/src/oh-installdocs.sh b/src/oh-installdocs.sh index 452bff5..f950651 100644 --- a/src/oh-installdocs.sh +++ b/src/oh-installdocs.sh @@ -19,17 +19,13 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +. @@LIBDIR@@/opkhelper/messages + print_usage() { printf 'Usage: %s providing_pkg\n' "$1" } -error() -{ - printf 'oh-installdocs: Error: %s\n' "${1}" >&2 - exit 1 -} - if [ ${#} -ne 1 ]; then print_usage ${0} >&2 exit 1 @@ -41,21 +37,19 @@ for pkgdir in *.data/; do mkdir -p ${pkg}.data/usr/share/doc/ if [ ${pkg} = ${1} ]; then # Make the providing package provide the documentation files. - printf 'oh-installdocs: Installing package documentation into package "%s"...\n' \ - "${pkg}" + oh_info 'Installing package documentation into package "%s"...' "${pkg}" mkdir -p ${pkg}.data/usr/share/doc/${pkg} - [ ! -f ../copyright ] && error 'Missing "copyright" file' - [ ! -f ../changelog ] && error 'Missing "changelog" file' + [ ! -f ../copyright ] && oh_error 'Missing "copyright" file' + [ ! -f ../changelog ] && oh_error 'Missing "changelog" file' cp ../copyright ${pkgdir}/usr/share/doc/${pkg}/copyright || \ - error 'Cannot copy documentation files' + oh_error 'Cannot copy documentation files' cp ../changelog ${pkgdir}/usr/share/doc/${pkg}/changelog.dist || \ - error 'Cannot copy documentation files' + oh_error 'Cannot copy documentation files' else # Make dependent packages link to the providing package's documentation # directory. - printf 'oh-installdocs: Making link to documentation in package "%s"...\n' \ - "${pkg}" + oh_info 'Making link to documentation in package "%s"...' "${pkg}" ln -s /usr/share/doc/${1} ${pkgdir}/usr/share/doc/${pkg} || \ - error 'Cannot make link to documentation files' + oh_error 'Cannot make link to documentation files' fi done -- cgit v0.9.1