How to make `MANPATH=~/.nmap/doc man 1 nmap` look for nmap.1?

I recently decided that since quite often I experiment with the latest version of nmap, it might be a good idea to keep its SVN checkout in ~/.nmap without installing and just run svn up; make to make it up to date. я добавил ~/.nmap в $PATH and just realized that with this setup, I cannot run man nmap больше. Я читаю на $MANPATH and realized that this doesn't seem to work for me:

[14:51:28][~/.nmap]$ manpath                                          
manpath: warning: $MANPATH set, prepending /etc/man_db.conf
/home/d/virtualenv/share/man:/usr/local/man:/usr/local/share/man:/usr/share/man:/usr/man:/home/d/.nmap/docs/man-xlate/:/home/d/.nmap/docs
[14:51:32][~/.nmap]$ strace  man 1 nmap 2>&1 | egrep 'nmap.1|write'
stat("/home/d/.nmap/docs/zenmap.1", {st_mode=S_IFREG|0664, st_size=5943, ...}) = 0
stat("/home/d/.nmap/docs/nmap.1", {st_mode=S_IFREG|0664, st_size=183621, ...}) = 0
access("/usr/share/man/man1/nmap.1.gz", R_OK) = -1 ENOENT (No such file or directory)
write(2, "No manual entry for nmap in sect"..., 38No manual entry for nmap in section 1

Почему это и как я могу это исправить? Я заметил, что man also looks for a file named index.db в ~/.nmap/docs and cannot find it, perhaps this is a clue?

1 ответ

Решение

Проблема в том, что каталог docs не имеет структуры каталогов, которая требуется человеку (nmap.1 должен быть в man1 подкаталог), так же, как при использовании -M опция:

    -M path, --manpath=path
          Specify an alternate manpath to use.  By default,  man  uses
          manpath  derived code to determine the path to search.  This
          option  overrides  the  $MANPATH  environment  variable  and
          causes option -m to be ignored.

          A  path  specified as a manpath must be the root of a manual
          page hierarchy structured into sections as described in  the
          man-db  manual  (under  "The  manual page system").  To view
          manual pages outside such hierarchies, see the -l option.

Когда используешь make install man-страницы установлены в подкаталогах правильной категории. так указывая MANPATH в директорию docs напрямую работать не будет.

Другие вопросы по тегам