Bug 184395 - [PATCH] ports/Mk/bsd.stage.mk: Fix symlinked manpages
Summary: [PATCH] ports/Mk/bsd.stage.mk: Fix symlinked manpages
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Port Management Team
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-30 12:10 UTC by Oliver Fromme
Modified: 2014-06-15 23:01 UTC (History)
2 users (show)

See Also:


Attachments
file.diff (422 bytes, patch)
2013-11-30 12:10 UTC, Oliver Fromme
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Fromme 2013-11-30 12:10:00 UTC
There's a bug in ports/Mk/bsd.stage.mk that is triggered when
there is a manual page that is a symlink to another manual page
in a DIFFERNET section.  For example, the software audio/sox
provides this symlink:

    /usr/local/man/man7/soxeffect.7 -> ../man1/sox.1

When bsd.stage.mk compresses the manual pages, it destroys the
relative path, so the result is this:

    /usr/local/man/man7/soxeffect.7.gz -> sox.1.gz

Consequently, "man soxeffects" doesn't work, and the weekly
periodic script produces this:

    Rebuilding whatis database:
    makewhatis: /usr/local/man/man7/soxeffect.7.gz: No such file or directory

Fix: The patch actually simplifies this part of the script
considerably.  The "rm" command is superfluous because
of the -f option to ${LN}.  This also means that there
is no need to store the result of "readlink" in a
temporary variable ("dest").

The original code changed to the directory of the symlink
and then re-created the symlink without any paths.  This
is completely useless and caused the bug.  Please note
that symlinks are opaque strings that don't depend on the
current directory.  There is no need to change to the
symlink's directory, and there is no need to modify the
symlink's target in any way (except appending .gz, of
course).

IMPORTANT:

When this patch is committed, please also close the PR
ports/184264 which is erroneously in state "feedback"
waiting for the maintainer of the sox port.  This is
*not* a bug in the sox port, so its maintainer can't
do much about it.

How-To-Repeat: 
Install audio/sox and try these commands:

# ls -l /usr/local/man/man7/soxeffect.7.gz
# man 7 soxeffect
# /etc/periodic/weekly/320.whatis
Comment 1 Antoine Brodin freebsd_committer freebsd_triage 2013-11-30 16:21:14 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to maintainer
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2013-12-06 18:07:40 UTC
Responsible Changed
From-To: portmgr->bdrewery

I'll take it.
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2014-02-11 16:57:47 UTC
Responsible Changed
From-To: bdrewery->portmgr

back to portmgr
Comment 4 Mark Linimon freebsd_committer freebsd_triage 2014-06-02 01:58:17 UTC
Infrastructure PR.
Comment 5 commit-hook freebsd_committer freebsd_triage 2014-06-15 23:01:25 UTC
A commit references this bug:

Author: bapt
Date: Sun Jun 15 23:01:17 UTC 2014
New revision: 357938
URL: http://svnweb.freebsd.org/changeset/ports/357938

Log:
  Fix symlinks of manpage after compression

  PR:		184395
  Submitted by:	oliver.fromme@secnetix.de

Changes:
  head/Mk/bsd.stage.mk