Working with man pages and appropos

I have installed Haiku as a virtualbox virtual machine on my
Debian-based Linux system.
Installed from haiku-r1beta6-x86_64-anyboot.iso

It is one of many VMs that I have: Windows 10 with CYGWIN, Windows 11
with CYGWIN, FreeBSD, Solaris, and Macos.

I have an Apache web server on my Linux system. I have written a
cgi-bin script that accesses the hosted virtual machines using
ssh/sshpass to retrieve and present the virtual machine’s available
online man pages.

I see that Haiku has these online man pages. So I would like to add
Haiku to the set of systems that I can support in accessing them.

As a part of the man page presentaion is initally presenting a list of
the available pages, For this I use the hosted system’s appropos (or
equivalent) command. This is also used in performing searches.

My problem with Haiku while there is a appropos command all it
presents is ‘command not found’. Looking into things further there is
reference to the makewhatis command. But running this command does
nothing. And the appropos command still returns nothing.

So my question/problem is how can I on Haiku get the appropos commnd
to run and present man page information?

1 Like

If man is part of the base system, certainly apropos should be as well.

Me also tried it.
I assume at ports such data that includes the man pages, mostly not delivered with the ported software - so no pages on the Haiku system to show.
Command like man and apropos just sits there as items of basic GNU programs, possibly parts of a GNU tool package or built-in command of the Bourne shell, but nothing else.

you may check

pkgman search cmd:man
pkgman search cmd:apropos

From which package they come from ..

+++

Well I searched the net, and asked

a ) ‘is man command a shell built-in ?’

I got it’s external, standalone binary program - it is pager for manuals of UNIX/Linux systems (that’s part I was surely know - now I was confirmed as external one)

“The easiest way to determine whether a command is built-in or external is by running the type command.”

a ) ‘is apropos command a shell built-in ?’

I got it’s also an external, standalone binary program

So, it worth to find the package with the above lines I wrote ..
We may try to search a Haiku package with manpages in the package names -
if there’s no shuch ones, then you won’t get manuals with Haiku in terminal, but with lynx browser, to search these command online to find online version of manual pages of Linux man pages :smiley:

:cowboy_hat_face:

We don’t really use the man system outselves at all.
man itself is part of posix, but apropos is not.

Where did you get this info from? If you say “the internet” you should atleast include a source, because copying those AI overviews here is not allowed. Also note that “command -v” is the correct way to figure out where a command sits, in posix. type is not part of posix.

It’s in mandoc:

Doesn’t seem to function though?

~> apropos -v
apropos: invalid option -- 'v'
usage: apropos [-afk] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
               [-s section] expression ...
~> apropos aclocal
apropos: nothing appropriate
~> man aclocal (working)
~> apropos -C /system/documentation/man/man1/aclocal.1
usage: apropos [-afk] [-C file] [-M path] [-m path] [-O outkey] [-S arch]
               [-s section] expression ...

1 Like

I didn’t mean it should be there because POSIX; I guess it’s just one of those things I got used to being everywhere.

Ok, it is not Posix,

But can it be supported? Which means I guess the other parts (the whatis DB and all) as well.

probably, yeah. But seeing as we don’t ship our documentation in a man compatible format it would likely not fix your initial problem

No I don’t need/want all documentation. Just the man pages. I have over 40 years of programming. Maybe could work on this. How do I get the source? I see that things are compiled with gcc. Well I guess I need to read the docs on developer contributions. And, my primary editor is Emacs. Any thoughts or plans of having that on Haiku?

1 Like

OK. I have done git clone https://review.haiku-os.org/haiku and resulting tree does not show man or apropos. Am I missing something?

The command(s) are not in Haikus source tree, if you want to figure out why they work or do not work you will have to work on haikuports instead. Both commands seem to be in the mandoc package. You can check this with pkgman, for example
“pkgman search cmd:apropos” or “pkgman search cmd:man”

> ~> pkgman search cmd:man
Status  Name      Description

    manaplus  A free opensource 2D MMORPG client                      

S       mandoc    A suite of tools compiling mdoc from the OpenBSD project
netpbm    Toolkit for manipulation of graphic images
s       nss       Mozilla’s library that implements PKI support

~> pkgman search cmd:apropos
Status  Name    Description

S       mandoc  A suite of tools compiling mdoc from the OpenBSD project

You can get the recipe from haikuports GitHub - haikuports/haikuports: Software ports for the Haiku operating system. · GitHub

Emacs is also already available, you can install it with “pkgman install app:emacs”

1 Like

HaikuPorts’s .patchset for mandoc needs some serious rework, in order to properly fix some bugs it currently has.

I guess the most visible symptom so far is getting:

man: outdated mandoc.db lacks diff(1) entry, run makewhatis /boot/system/documentation/man

after using man diff, for example.

No amount of calls to makewhatis will fix it, as there are bugs on our .patchset, as mentioned.

Needs someone interested, and more skilled and focused than myself (those last two, not too difficult) to look into it. Ideally, it should use Haiku’s find_paths() API to support all the possible man page (and MANDOC_DB_DIR) locations (system/home, packaged/non-packaged).

Current patchset, IIRC, attempt to support all four, but is missing some adjustments at the very least.

Edit:

Some relevant (still open) tickets:

and

Thank you I have installed emacs. Question: pn other systems the startup file is at ~/.emacs, I have found references for Haiku that is is at ~.emacs.d/init.el ,nut that does not seem to work :

(setq auto-save-file-name-transforms
      `((".*" ,temporary-file-directory t)))

Any thoughts?

Emacs should still allow loading the init file from ~/.emacs/init.el but that’s not the preferred location on Haiku. Dotfiles in the home directory are discouraged on Haiku, so Emacs will load files from ~/config/settings/emacs/init.el

1 Like

I have the haikuports using git. But, forgive me, I don’t yet understand what a recipe file is all about. Maybe a pointer t some docs? And I do not see any source files. Sorry about this, I am trying to learn git and how you all have set up things. Yes I have software experience, but this is all new to me.

Starting points:

May be the last update. I have a VM here with mandoc-1.14.3-1-x86_gcc2. Same ‘outdated mandoc.db’ message on issuing man, but it disappears after running the suggested command. apropos works, at least after running that, I did not try before. The db goes to /boot/system/var/mandoc/boot/system/documentation/man/mandoc.db, though, not sure if that long path is the expected one.

The haikuports recipes are more like bash scripts that pull the sources, extract them in a root environment and launch the build with in the end creates the package (short version) :slight_smile:

If you need help on something there just shout out or drop in the IRC channel, mostly someone is around to get you started. (@BiPolar already pointed you to the right place to start).

For me, this has happened since several years ago, and it is still happening for me on beta6 with mandoc 1.14.6-1 installed. I even tried to fix the issue myself at least twice or trice, last time on mandoc-1.14.3 about 1.5 years ago.

With 1.14.6 (have’t tried it until now)… I can’t find mandoc.db anywhere on my system after running makewhatis. I wonder what’s the difference between your system and mine.

Edit: I think I remember older versions did created the mandoc.db, but still issued the warning.