1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

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
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