From d252d67d4885448939f9957c5dcd4864becd7a8c Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Wed, 25 Apr 2012 00:28:38 -0400 Subject: Clean up oh-installdocs and install a "README". --- diff --git a/ChangeLog b/ChangeLog index a2aec43..906ab51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 1.0.0 (2012-04-00) [ P. J. McDermott ] + * Make oh-installdocs copy an optional package "README" file into the + providing binary package. * Standardize error, warning, and informational messages throughout all tools. * Use non-static shell paths in scripts. diff --git a/src/oh-installdocs.sh b/src/oh-installdocs.sh index f950651..07a458b 100644 --- a/src/oh-installdocs.sh +++ b/src/oh-installdocs.sh @@ -34,22 +34,25 @@ fi # Iterate through packages that have been installed. for pkgdir in *.data/; do pkg=${pkgdir%'.data/'} - mkdir -p ${pkg}.data/usr/share/doc/ + docdir=${pkgdir}usr/share/doc + mkdir -p ${docdir} if [ ${pkg} = ${1} ]; then # Make the providing package provide the documentation files. oh_info 'Installing package documentation into package "%s"...' "${pkg}" - mkdir -p ${pkg}.data/usr/share/doc/${pkg} - [ ! -f ../copyright ] && oh_error 'Missing "copyright" file' - [ ! -f ../changelog ] && oh_error 'Missing "changelog" file' - cp ../copyright ${pkgdir}/usr/share/doc/${pkg}/copyright || \ - oh_error 'Cannot copy documentation files' - cp ../changelog ${pkgdir}/usr/share/doc/${pkg}/changelog.dist || \ - oh_error 'Cannot copy documentation files' + mkdir -p ${docdir}/${pkg} + cp ../copyright ${docdir}/${pkg}/copyright || \ + oh_error 'Cannot copy "copyright"' + cp ../changelog ${docdir}/${pkg}/changelog.dist || \ + oh_error 'Cannot copy "changelog"' + if [ -f ../README ]; then + cp ../README ${docdir}/${pkg}/README.dist || \ + oh_error 'Cannot copy package "README"' + fi else # Make dependent packages link to the providing package's documentation # directory. oh_info 'Making link to documentation in package "%s"...' "${pkg}" - ln -s /usr/share/doc/${1} ${pkgdir}/usr/share/doc/${pkg} || \ + ln -s /usr/share/doc/${1} ${docdir}/${pkg} || \ oh_error 'Cannot make link to documentation files' fi done -- cgit v0.9.1