Date: Sat, 30 Nov 2013 13:00:32 +0100 (CET) From: Oliver Fromme <oliver.fromme@secnetix.de> To: FreeBSD-gnats-submit@freebsd.org Cc: Oliver Fromme <olli@secnetix.de> Subject: ports/184395: [PATCH] ports/Mk/bsd.stage.mk: Fix symlinked manpages Message-ID: <201311301200.rAUC0WYG050710@grabthar.secnetix.de> Resent-Message-ID: <201311301210.rAUCA0fb073203@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 184395 >Category: ports >Synopsis: [PATCH] ports/Mk/bsd.stage.mk: Fix symlinked manpages >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sat Nov 30 12:10:00 UTC 2013 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: n/a >Organization: secnetix GmbH & Co. KG http://www.secnetix.de/bsd >Environment: The problem is present in the current ports collection (2013-11-30) and affects all FreeBSD versions. >Description: 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 >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 >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. --- bsd.stage.mk.orig 2013-11-23 10:48:42.000000000 +0100 +++ bsd.stage.mk 2013-11-30 12:35:51.000000000 +0100 @@ -61,9 +61,7 @@ done ; \ done ; \ ${FIND} $$dir -type l \! -name "*.gz" | while read link ; do \ - dest=$$(readlink $$link) ; \ - rm -f $$link ; \ - (cd $${link%/*} ; ${LN} -sf $${dest##*/}.gz $${link##*/}.gz) ;\ + ${LN} -sf $$(readlink $$link).gz $$link.gz ;\ done; \ done .endif >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201311301200.rAUC0WYG050710>