retitle 384301 man-db: symlink pages sorted excessively low
thanks

Sorry I took so long to reply to this bug report.

On Wed, Aug 23, 2006 at 12:51:44PM +0200, Daniel Lublin wrote:
> The man program does not seem to honour the order of the directories given 
> in the manpath. If a man page exists in several directories, they are 
> displayed in reverse manpath order (in the code, the directory entries are 
> inserted at the head of a linked list, which is then iterated by starting 
> at the head).

I'm not sure this is an accurate description. Directories are, unless
I'm missing something (and I apologise for the state of src/manp.c!)
inserted at the tail of a list, not the head. The results of globbing
are inserted into an array, and then display candidates are generated
from that and added to a linked list. It's true that they're sometimes
added to that linked list too early, which I'm fixing at the moment.
They are certainly not generally inserted at the head, though.

> Is this behaviour intentional, or is the display order just undefined? I 
> feel that it would be more natural if the manpath order was honoured, the 
> way the PATH is when finding executables to run. The manpath and PATH are 
> really kinda related.

Normally it is, but ...

> Since /usr/local comes first in the PATH (atleast on Debian), I would 
> expect to see the man page for a locally-installed rtorrent when i do "man 
> rtorrent", not the one for /usr/bin/rtorrent. But obviously I don't.
> 
> Example:
> 
>   ujezd:~> manpath
>   /usr/local/man:/usr/share/man:/usr/man
> 
>   ujezd:~> find /usr/local/man/ /usr/share/man/ | grep rtorr
>   /usr/local/man/man1/rtorrent.1
>   /usr/share/man/man1/rtorrent.1.gz
> 
>   ujezd:~> man -w rtorrent
>   /usr/share/man/man1/rtorrent.1.gz
> 
>   ujezd:~> man -a -w rtorrent
>   /usr/share/man/man1/rtorrent.1.gz
>   /usr/local/i/rtorrent/svn/share/man/man1/rtorrent.1

What's happening here is actually nothing to do with the manpath. If
/usr/local/man/man1/rtorrent.1 were a regular file then you'd find that
everything worked as expected. The problem is that symlinks are compared
lower than regular files, and this beats manpath ordering; that probably
isn't justified, and I'll look into fixing this.

Cheers,

-- 
Colin Watson                                       [EMAIL PROTECTED]



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to