Page MenuHomeFreeBSD

PR227922: man -k/-f does not search man pages/mandoc.db from packages/ports (MANPATH problem)
ClosedPublic

Authored by yuripv on Oct 7 2018, 7:26 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Aug 11, 4:27 AM
Unknown Object (File)
Mon, Aug 5, 11:44 AM
Unknown Object (File)
Mon, Aug 5, 10:58 AM
Unknown Object (File)
Jul 12 2024, 1:29 PM
Unknown Object (File)
Jul 2 2024, 3:16 PM
Unknown Object (File)
Jul 2 2024, 3:16 PM
Unknown Object (File)
Jul 2 2024, 3:16 PM
Unknown Object (File)
Jul 2 2024, 4:27 AM
Subscribers

Details

Summary

Use output of manpath(1) to set defpaths if -M is not specified.

This seems to be the easiest to solve the issue without doing massive modifications to vendor code as OpenBSD's man.conf(5) contents are different from what we have.

Test Plan
$ ./apropos -s3 IPC
IPC::Cmd(3) - finding and running system commands made easy
IPC::Msg(3) - SysV Msg IPC object class
IPC::Open2(3) - open a process for both reading and writing using open2()
IPC::Open3(3) - open a process for reading, writing, and error handling using open3()
IPC::Semaphore(3) - SysV Semaphore IPC object class
IPC::SharedMem(3) - SysV Shared Memory IPC object class
IPC::SysV(3) - System V IPC constants and system calls
Test2::IPC(3) - Turn on IPC for threading or forking support.
Test2::IPC::Driver(3) - Base class for Test2 IPC drivers.
Test2::IPC::Driver::Files(3) - Temp dir + Files concurrency model.
au_to_arg32, au_to_arg, au_to_arg64, au_to_attr64, au_to_data, au_to_exec_args, au_to_exec_env, au_to_exit, au_to_file, au_to_groups, au_to_header, au_to_header32, au_to_header64, au_to_in_addr, au_to_in_addr_ex, au_to_ip, au_to_ipc, au_to_ipc_perm, au_to_iport, au_to_me, au_to_newgroups, au_to_opaque, au_to_path, au_to_process32, au_to_process32_ex, au_to_process64, au_to_process64_ex, au_to_return, au_to_return32, au_to_return64, au_to_seq, au_to_sock_inet128, au_to_sock_inet32, au_to_subject, au_to_subject32, au_to_subject32_ex, au_to_subject64, au_to_subject64_ex, au_to_subject_ex, au_to_text, au_to_trailer, au_to_zonename, au_to_process, au_to_process_ex, au_to_sock_inet, au_token, au_to_header32_ex, au_to_header_ex, au_to_socket_ex(3) - routines for generating BSM audit tokens
ftok(3) - create IPC identifier from path name
$ ./whatis -s3 IPC
IPC::Cmd(3) - finding and running system commands made easy
IPC::Msg(3) - SysV Msg IPC object class
IPC::Open2(3) - open a process for both reading and writing using open2()
IPC::Open3(3) - open a process for reading, writing, and error handling using open3()
IPC::Semaphore(3) - SysV Semaphore IPC object class
IPC::SharedMem(3) - SysV Shared Memory IPC object class
IPC::SysV(3) - System V IPC constants and system calls
Test2::IPC(3) - Turn on IPC for threading or forking support.
Test2::IPC::Driver(3) - Base class for Test2 IPC drivers.
Test2::IPC::Driver::Files(3) - Temp dir + Files concurrency model.

Our man sadly doesn't grok section setting for -k/-f, so:

$ PATH=.:$PATH man -k IPC
ipcrm(1) - remove the specified message queues, semaphore sets, and shared segments
ipcs(1) - report System V interprocess communication facilities status
perlipc(1) - Perl interprocess communication (signals, fifos, pipes, safe subprocesses, sockets, and semaphores)
IPC::Cmd(3) - finding and running system commands made easy
IPC::Msg(3) - SysV Msg IPC object class
IPC::Open2(3) - open a process for both reading and writing using open2()
IPC::Open3(3) - open a process for reading, writing, and error handling using open3()
IPC::Semaphore(3) - SysV Semaphore IPC object class
IPC::SharedMem(3) - SysV Shared Memory IPC object class
IPC::SysV(3) - System V IPC constants and system calls
Test2::IPC(3) - Turn on IPC for threading or forking support.
Test2::IPC::Driver(3) - Base class for Test2 IPC drivers.
Test2::IPC::Driver::Files(3) - Temp dir + Files concurrency model.
bhnd_chipc(4) - Broadcom Home Networking Division ChipCommon Driver
au_to_arg32, au_to_arg, au_to_arg64, au_to_attr64, au_to_data, au_to_exec_args, au_to_exec_env, au_to_exit, au_to_file, au_to_groups, au_to_header, au_to_header32, au_to_header64, au_to_in_addr, au_to_in_addr_ex, au_to_ip, au_to_ipc, au_to_ipc_perm, au_to_iport, au_to_me, au_to_newgroups, au_to_opaque, au_to_path, au_to_process32, au_to_process32_ex, au_to_process64, au_to_process64_ex, au_to_return, au_to_return32, au_to_return64, au_to_seq, au_to_sock_inet128, au_to_sock_inet32, au_to_subject, au_to_subject32, au_to_subject32_ex, au_to_subject64, au_to_subject64_ex, au_to_subject_ex, au_to_text, au_to_trailer, au_to_zonename, au_to_process, au_to_process_ex, au_to_sock_inet, au_token, au_to_header32_ex, au_to_header_ex, au_to_socket_ex(3) - routines for generating BSM audit tokens
ftok(3) - create IPC identifier from path name
mbuf, m_adj, M_ALIGN, m_align, m_append, m_apply, m_cat, m_catpkt, m_collapse, m_copyback, m_copydata, m_copym, m_copypacket, m_copyup, m_defrag, m_devget, m_dup, m_dup_pkthdr, m_fixhdr, m_free, m_freem, m_get, m_get2, m_getcl, m_gethdr, m_getjcl, m_getm, m_getptr, M_LEADINGSPACE, m_length, m_move_pkthdr, M_MOVE_PKTHDR, M_PREPEND, m_prepend, m_pulldown, m_pullup, m_split, M_TRAILINGSPACE, m_unshare, M_WRITABLE, MCHTYPE, MCLGET, MEXTADD, MGET, MGETHDR, MH_ALIGN, mtod(9) - memory management in the kernel IPC subsystem

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

yuripv retitled this revision from PR227992: man -k/-f does not search man pages/mandoc.db from packages/ports (MANPATH problem) to PR227922: man -k/-f does not search man pages/mandoc.db from packages/ports (MANPATH problem).Oct 16 2018, 10:41 AM

what about building MANPATH before calling apropos in man(1) ?

That would be less intrusive

In D17454#375266, @bapt wrote:

what about building MANPATH before calling apropos in man(1) ?

That would be less intrusive

That was mentioned in the PR as possible workaround, but it doesn't solve the issue when apropos/whatis are called directly and not using man(1)'s -k/-f flags.

We could bring again apropos and whatis as hardlinks to man(1) moving the binaries in libexec so manpath is built before calling them as well

In D17454#375268, @bapt wrote:

We could bring again apropos and whatis as hardlinks to man(1) moving the binaries in libexec so manpath is built before calling them as well

That's another alternative, yes, and looks like we need to make a decision here. For me, I'd rather keep the mandoc's binaries in the PATH to not add more indirection, and have this simple patch.

fine with me. my plan was in long term to extend mandoc's man.conf to have the missing features we have in our man(1) like able to read: /usr/local/etc/man.d/*
And then swictch fully to upstream's man.conf and remove our man(1), so go ahead for your patch :)

This revision is now accepted and ready to land.Oct 16 2018, 3:11 PM
In D17454#375324, @bapt wrote:

fine with me. my plan was in long term to extend mandoc's man.conf to have the missing features we have in our man(1) like able to read: /usr/local/etc/man.d/*
And then swictch fully to upstream's man.conf and remove our man(1), so go ahead for your patch :)

You know, I was actually thinking about doing the same, but it just looked like too big change at the moment :) if you have any notes or ideas already, let's do just that after 12 is released.

I just had the idea, and nothing more advanced :)

This revision was automatically updated to reflect the committed changes.