From dae3f9deefdb86f726a68dc89a7391e9df7517df Mon Sep 17 00:00:00 2001 From: Chantry Xavier Date: Thu, 13 Mar 2008 00:25:38 +0100 Subject: Add zipman makepkg option. All other steps in tidy_install function were already controlled by an option in makepkg.conf, so this patch adds an option for the man page compression step too. This will allow to keep man pages uncompressed, which is required for some special meta man page, like the zshall one (see FS#4580). Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-March/011472.html Signed-off-by: Chantry Xavier --- scripts/makepkg.sh.in | 64 +++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 30 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index f2f7109b..1eb3d3a7 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -733,37 +733,41 @@ tidy_install() { rm -rf ${DOC_DIRS[@]} fi - msg2 "$(gettext "Compressing man pages...")" - local manpage mandirs ext file link hardlinks hl - mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man" - find ${mandirs} -type f 2>/dev/null | while read manpage ; do - # check file still exists (potentially compressed with hard link) - if [ -f ${manpage} ]; then - ext="${manpage##*.}" - file="${manpage##*/}" - if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then - # update symlinks to this manpage - find ${mandirs} -lname "$file" 2>/dev/null | while read link ; do - rm -f "$link" - ln -sf "${file}.gz" "${link}.gz" - done - # find hard links and remove them - # the '|| true' part keeps the script from bailing if find returned an - # error, such as when one of the man directories doesn't exist - hardlinks="$(find ${mandirs} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true - for hl in ${hardlinks}; do - rm -f "${hl}"; - done - # compress the original - gzip -9 "$manpage" - # recreate hard links removed earlier - for hl in ${hardlinks}; do - ln "${manpage}.gz" "${hl}.gz" - chmod 644 ${hl}.gz - done + if [ "$(check_option zipman)" = "y" ]; then + msg2 "$(gettext "Compressing man pages...")" + local manpage mandirs ext file link hardlinks hl + mandirs="usr/man usr/share/man usr/local/man usr/local/share/man opt/*/man" + find ${mandirs} -type f 2>/dev/null | + while read manpage ; do + # check file still exists (potentially compressed with hard link) + if [ -f ${manpage} ]; then + ext="${manpage##*.}" + file="${manpage##*/}" + if [ "$ext" != "gz" -a "$ext" != "bz2" ]; then + # update symlinks to this manpage + find ${mandirs} -lname "$file" 2>/dev/null | + while read link ; do + rm -f "$link" + ln -sf "${file}.gz" "${link}.gz" + done + # find hard links and remove them + # the '|| true' part keeps the script from bailing if find returned an + # error, such as when one of the man directories doesn't exist + hardlinks="$(find ${mandirs} \! -name "$file" -samefile "$manpage" 2>/dev/null)" || true + for hl in ${hardlinks}; do + rm -f "${hl}"; + done + # compress the original + gzip -9 "$manpage" + # recreate hard links removed earlier + for hl in ${hardlinks}; do + ln "${manpage}.gz" "${hl}.gz" + chmod 644 ${hl}.gz + done + fi fi - fi - done + done + fi if [ "$(check_option strip)" = "y" ]; then -- cgit v1.2.3-70-g09d2