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 <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2010-03-05 14:17:57 +10:00 committed by Dan McGee
parent 5fe41df8a9
commit 6f0ffb2386

View file

@ -810,17 +810,18 @@ tidy_install() {
local manpage ext file link hardlinks hl local manpage ext file link hardlinks hl
find ${MAN_DIRS[@]} -type f 2>/dev/null | find ${MAN_DIRS[@]} -type f 2>/dev/null |
while read manpage ; do while read manpage ; do
# check file still exists (potentially compressed with hard link) ext="${manpage##*.}"
if [[ -f ${manpage} ]]; then file="${manpage##*/}"
ext="${manpage##*.}" if [[ $ext != gz && $ext != bz2 ]]; then
file="${manpage##*/}" # update symlinks to this manpage
if [[ $ext != gz && $ext != bz2 ]]; then find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null |
# update symlinks to this manpage while read link ; do
find ${MAN_DIRS[@]} -lname "$file" 2>/dev/null | rm -f "$link"
while read link ; do ln -sf "${file}.gz" "${link}.gz"
rm -f "$link" done
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 # find hard links and remove them
# the '|| true' part keeps the script from bailing if find returned an # the '|| true' part keeps the script from bailing if find returned an
# error, such as when one of the man directories doesn't exist # error, such as when one of the man directories doesn't exist