summaryrefslogtreecommitdiffstats
path: root/src/oh-installdocs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/oh-installdocs.sh')
-rw-r--r--src/oh-installdocs.sh24
1 files changed, 9 insertions, 15 deletions
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 <http://www.gnu.org/licenses/>.
+. @@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