From 6f0ffb23860e8d1b4593d60e970919ae7b31340d Mon Sep 17 00:00:00 2001 From: Allan McRae Date: Fri, 5 Mar 2010 14:17:57 +1000 Subject: makepkg: always update symlinks to compressed man pages When a man page has both symbolic and hard links, any symlink pointing to other than the alphabetically first hardlink was not "compressed" and left dangling towards the uncompressed man page. Fixes FS#18569. Signed-off-by: Allan McRae Signed-off-by: Dan McGee --- scripts/makepkg.sh.in | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 0fe06513..71352381 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -810,17 +810,18 @@ tidy_install() { local manpage ext file link hardlinks hl find ${MAN_DIRS[@]} -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 && $ext != bz2 ]]; then - # update symlinks to this manpage - find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null | - while read link ; do - rm -f "$link" - ln -sf "${file}.gz" "${link}.gz" - done + ext="${manpage##*.}" + file="${manpage##*/}" + if [[ $ext != gz && $ext != bz2 ]]; then + # update symlinks to this manpage + find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null | + while read link ; do + rm -f "$link" + ln -sf "${file}.gz" "${link}.gz" + done + + # check file still exists (potentially already compressed due to hardlink) + if [[ -f ${manpage} ]]; then # 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 -- cgit v1.2.3-70-g09d2