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 <[email protected]>
---
 scripts/makepkg.sh.in |   23 ++++++++++++-----------
 1 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 3d987ac..f8072f9 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -836,17 +836,18 @@ tidy_install() {
                local manpage ext file link hardlinks hl
                find ${man_di...@]} -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_di...@]} -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_di...@]} -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
-- 
1.7.0.1



Reply via email to