Provided by: man-db_2.10.2-2_amd64 bug

名称

       manpath - 格式化 /etc/manpath.config 文件

描述

       manpath  配置文件是手册页工具程序用来在运行时访问用户的 manpath 的。它指示了哪些手册页层次
       结构(manpath)应视为系统层次结构,并向它们分配用于保存 cat 文件的目录。

       如果已经设置了环境变量  $MANPATH/etc/manpath.config 中包含的信息不会覆盖它。

搜索路径

       By default, man-db examines the user's $PATH.  For each path_element found there, it  adds
       manpath_element to the search path.

       If  there  is no MANPATH_MAP line in the configuration file for a given path_element, then
       it adds  all  of  path_element/../man,  path_element/man,  path_element/../share/man,  and
       path_element/share/man that exist as directories to the search path.

       It then adds any MANDATORY_MANPATH entries from the configuration file to the search path.

       Finally,  if the --systems option is used or the $SYSTEM environment variable is set, then
       that should consist of a sequence of operating system names separated by commas or colons.
       This  acts  as  a  template,  expanding the search path once more to allow access to other
       operating systems' manual pages: for each system name, man-db looks for  that  name  as  a
       subdirectory  of each entry in the search path, and adds it to the final search path if it
       exists.  A system name of man inserts the normal search path without subdirectories.   For
       example,  if  the search path would otherwise have been /usr/share/man:/usr/local/man, and
       $SYSTEM   is   set   to   newOS:man,   then   the    final    search    path    will    be
       /usr/share/man/newOS:/usr/share/man:/usr/local/man/newOS:/usr/local/man.

       The  $MANPATH  environment  variable  overrides man-db's default manual page search paths.
       Most users should not need to set it.  Its syntax is  similar  to  the  $PATH  environment
       variable:  it consists of a sequence of directory names separated by colons.  It overrides
       the default search path described above.

       If the value of $MANPATH starts with a colon, then the default search path is added at its
       start.   If the value of $MANPATH ends with a colon, then the default search path is added
       at its end.  If the value of $MANPATH contains a  double  colon  (::),  then  the  default
       search path is inserted in the middle of the value, between the two colons.

格式

       当前支持以下字段类型:

       # 注释 空行或以 # 开头的行将视为注释并忽略。

       MANDATORY_MANPATH manpath_element
              这种形式的行指定每个自动生成的 $MANPATH 应包含的 manpath。它通常包含 /usr/manMANPATH_MAP path_element manpath_element
              这种形式的行将设置   $PATH   到   $MANPATH  的映射。对于在用户  $PATH  中找到的每个
              path_element,会将 manpath_element 添加到 $MANPATHMANDB_MAP manpath_element [ catpath_element ]
              这种形式的行指示哪些  manpath  视为系统  manpath,还可指定它们的  cat  文件保存在哪
              里。如果   man   是一个   setuid  程序,此字段类型将尤为重要,因为(当在系统配置文件
              /etc/manpath.config 而不是每个用户配置文件 .manpath 中时)它指示哪些手册页层次结构作
              为 setuid 用户访问,哪些作为调用用户访问。

              系统手册页层次结构通常保存在    /usr    下,如    /usr/man,    /usr/local/man/usr/X11R6/man。

              如果来自某个特定  manpath_element  的  cat   页面不保存,或保存在传统位置,可以忽略
              catpath_element。

              Traditional  cat  placement  would  be impossible for read only mounted manual page
              hierarchies and because of this it is  possible  to  specify  any  valid  directory
              hierarchy for their storage.  To observe the Linux FSSTND the keyword FSSTND can be
              used in place of an actual directory.

              不幸的是,需要指定   所有   系统    man    目录树的路径,包括替代的操作系统路径,如
              /usr/man/sun 和任何的 NLS 区域语言 路径,如 /usr/man/de_DE.88591。

              由于是按写的顺序逐行解析的,因此必须先列出作为另一层次结构的次级结构的  manpath,否
              则会出现不正确的匹配。例如,/usr/man/de_DE.88591 应出现在 /usr/man 之前。

       DEFINE  
              这种形式的行定义各种配置变量;请查看默认的配置文件了解手册分页工具使用了哪些变
              量。它们包括指向各种程序的路径(如 greptbl),和这些程序的默认参数集。

       SECTION 章节 ...
              这种形式的行定义手册章节的搜索顺序。如果配置文件中没有 SECTION 指令,默认为:

                     SECTION 1 n l 8 3 0 2 5 4 9 6 7

              如果给出了多个 SECTION 指令,它们的章节列表会被合并。

              如果某个特定扩展不在列表中(像  1mh),它会和它所属章节的其他部分一起显示。这样的效果
              是,若要强制某种特定的顺序,您只需明确列出扩展。带扩展的章节通常应该与其主章节相
              邻(如“1 1mh 8 ...)。

              SECTIONS 是此指令的替代名称,也允许使用。

       MINCATWIDTH 宽度
              如果终端宽度小于 宽度,将不会创建(若缺少)或显示 cat 页面。默认值为 80。

       MAXCATWIDTH 宽度
              如果终端宽度大于 宽度,将不会创建(若缺少)或显示 cat 页面。默认值为 80。

       CATWIDTH 宽度
              如果 宽度 是非零的,对指定宽度的终端将总是格式化 cat 页面,不管实际使用的终端宽度是
              多少。此数值通常应在 MINCATWIDTHMAXCATWIDTH 设置的范围之内。

       NOCACHE
              此标志阻止 man(1) 自动创建 cat 页面。

BUGS

       除非完全准确的遵守了这些规则,否则手册分页工具会工作不正常。这些规则过于复杂了。

       https://gitlab.com/cjwatson/man-db/-/issues
       https://savannah.nongnu.org/bugs/?group=man-db