[pacman-dev] [PATCH] 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> --- 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_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 -- 1.7.0.1
On 05/03/10 14:33, Allan McRae wrote:
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>
As a side note, this was introduced by my first ever patch to makepkg/pacman! http://projects.archlinux.org/pacman.git/commit/?id=9615d823 . Before that, files with hardlinks were not compresses so symlinks never needed fixed. Allan
participants (1)
-
Allan McRae