Your message dated Thu, 20 Aug 2009 07:50:03 +0100
with message-id <[email protected]>
and subject line Re: Bug#163347: man-db: man page in "/usr/local" not found by 
its name
has caused the Debian Bug report #163347,
regarding man-db: sort symlinked pages according to the symlink name
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
163347: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=163347
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: man-db
Version: 2.4.0-10
Severity: normal

Hi,

I often use the "/usr/local" hierarchy to override various
"update-alternatives" settings that I don't like.  This way, I
never have to run "update-alternatives" by hand.

I have so far used this technique with good results.  When I
override a particular program, eg, in this case the debian
"md5sum" is overriden by the "md5sum.textutils" version, then I
make two symlinks in the "/usr/local" hierarchy, one for the
program executable, and one for its corresponding manual page.

The problem I am having is that there is no way to easily specify
that I want to have the "md5sum" manpage displayed which
corresponds to the "md5sum" executable that will be run by my
shell when I type "md5sum" as a command to the shell.

I have tried altering each stanza of "/etc/manpath.config" so that
the entries for "/usr/local/*" came before the other entries, but
this did not help in the case.

So basically, I expect man to display man pages according to the
priority that is implied by my PATH environment variable.

I also tried setting the MANPATH environment variable so that
"/usr/local/man" had priority, but this did not help either.

I did not run the "man --debug md5sum" command, because it should
be pretty clear what is happening here, just give a shout and I
will be happy to do this for you.

A summary typescript documenting my efforts is included below,

    318 jeff ~ $ echo $PATH
    
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/bin/X11:/usr/games:/home/jeff/bin:/home/jeff

    319 jeff ~ $ man -u md5sum
    man: warning: /usr/share/man/man8/etrn.8.gz: whatis parse for etrn(8) failed
    320 jeff ~ $ type -a md5sum
    md5sum is /usr/local/bin/md5sum
    md5sum is /usr/bin/md5sum

    321 jeff ~ $ man -wa md5sum
    /usr/share/man/man1/md5sum.1.gz /var/cache/man/cat1/md5sum.1.gz
    /usr/share/man/man1/md5sum.textutils.1.gz 
/var/cache/man/cat1/md5sum.textutils.1.gz

    322 jeff ~ $ man -a md5sum
    --Man-- next: md5sum(1) [ view (return) | skip (Ctrl-D) | quit (Ctrl-C) ]
    # displays debian md5sum first, then texturils md5sum.

    323 jeff ~ $ find /usr/local -name '*md5sum*' -ls
     58497    0 lrwxrwxrwx   1 root     staff          26 Sep 25 19:08 
/usr/local/bin/md5sum -> ../../bin/md5sum.textutils
     25229    0 lrwxrwxrwx   1 root     staff          45 Sep 25 19:08 
/usr/local/man/man1/md5sum.1.gz -> ../../../share/man/man1/md5sum.textutils.1.gz

    324 jeff ~ $ find /usr/local -name '*md5sum*' -print | xargs file
    /usr/local/bin/md5sum:           symbolic link to ../../bin/md5sum.textutils
    /usr/local/man/man1/md5sum.1.gz: symbolic link to 
../../../share/man/man1/md5sum.textutils.1.gz

    325 jeff ~ $ find /usr/local -name '*md5sum*' -print | xargs file -L
    /usr/local/bin/md5sum:           ELF 32-bit LSB executable, Intel 80386, 
version 1 (SYSV), for GNU/Linux 2.0.30, dynamically linked (uses shared libs), 
stripped
    /usr/local/man/man1/md5sum.1.gz: gzip compressed data, was 
"md5sum.textutils.1", from Unix, max compression

    366 jeff ~ $ export MANPATH=/usr/local/man:/usr/share/man:/usr/X11R6/man

    380 jeff ~ $ man -w md5sum
    /usr/share/man/man1/md5sum.1.gz /var/cache/man/cat1/md5sum.1.gz

In summary, I will state how I believe how man should behave, in
the absence of any overriding command line arguments,

    1. If the MANPATH environment variable is set, then man pages
       should be located in priority order using its path
       constituents.

    2. If the PATH environment variable is set, then man pages
       should be located in priority order using its path
       constituents, which are converted to a MANPATH using the
       current method.

    3. If the man page could not be found by 1. and 2. above, then
       the current method (as specified by /etc/manpth.config,
       etc.) should be used to locate the man page.

Thanks,
-- 
Jeff Sheinberg


-- System Information
Debian Release: testing/sarge
Kernel Version: Linux l1.bsrd.net 2.4.19-1 #1 Sat Aug 24 17:01:11 EDT 2002 i586 
unknown unknown GNU/Linux


Versions of the packages man-db depends on:
ii  bsdmainutils   5.20020211-5   More utilities from FreeBSD.
ii  debconf        1.0.32         Debian configuration management system
ii  dpkg           1.10.4         Package maintenance system for Debian
ii  groff          1.18-6         GNU troff text-formatting system
ii  groff-base     1.18-6         GNU troff text-formatting system (base syste
ii  libc6          2.2.5-14.3     GNU C Library: Shared libraries and Timezone
ii  libdb3         3.2.9-17       Berkeley v3 Database Libraries [runtime]




--- End Message ---
--- Begin Message ---
Source: man-db
Source-Version: 2.5.4-1

On Fri, Oct 04, 2002 at 11:22:17PM +0100, Colin Watson wrote:
> On Fri, Oct 04, 2002 at 04:33:49PM -0400, Jeff Sheinberg wrote:
> >     321 jeff ~ $ man -wa md5sum
> >     /usr/share/man/man1/md5sum.1.gz /var/cache/man/cat1/md5sum.1.gz
> >     /usr/share/man/man1/md5sum.textutils.1.gz 
> > /var/cache/man/cat1/md5sum.textutils.1.gz
> 
> OK, I think I see what's going on. It's not that man is getting the
> manpath wrong; it's computing that perfectly for me. Rather, it sees
> that md5sum(1) is an exact match for "md5sum", unlike
> md5sum.textutils(1), and therefore sorts md5sum(1) earlier. This
> heuristic was necessary in order to make case-insensitive searches
> behave sensibly.
> 
> The fix is to compare the name of the symlink rather than its target.
> Although they aren't quite the same bugs, fixing this is therefore quite
> closely bound up with fixing #129575, and I'll do them at the same time.

I just tried to write a test case for this with a view to fixing it, and
found that I could no longer reproduce the problem! I think that I
probably fixed this by accident while fixing #384301, or possibly while
rewriting the whole manual page candidate comparison code in order to
make 'man --wildcard' and 'man --regex' acceptably fast, so I'm guessing
that this is fixed as of man-db 2.5.4-1.

I've committed the test case anyway to make sure that this doesn't
recur. If you can see anything incomplete in it, please shout.

  
http://bzr.savannah.gnu.org/lh/man-db/trunk/annotate/1109?file_id=man1-20090819202808-2ppbct9jnjqc0uv0-1

Thanks,

-- 
Colin Watson                                       [[email protected]]


--- End Message ---

Reply via email to