diff options
author | Chantry Xavier <shiningxc@gmail.com> | 2008-03-13 00:25:38 +0100 |
---|---|---|
committer | Chantry Xavier <shiningxc@gmail.com> | 2008-03-16 23:22:17 +0100 |
commit | dae3f9deefdb86f726a68dc89a7391e9df7517df (patch) | |
tree | 12d2a8a552d42f1e567557f699021fe5e4c713fa /scripts | |
parent | 35135c0a0cbac592e72296c0ca64e9def0308942 (diff) |
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 <shiningxc@gmail.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/makepkg.sh.in | 64 |
1 files changed, 34 insertions, 30 deletions
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 |