Hi Justin,

Justin Haynes wrote on Fri, Sep 05, 2014 at 07:56:33PM -0500:

> How can one know if a command appearing in the man pages is excluded
> from the base install of an architecture without extracting base
> tarball to discover this fact?

You got quite some answers to that question.

In addition to that, there is one issue with the mdoc(7) language
that wasn't mentioned yet.  The language allows a manual to optionally
specify one single architecture it applies to.  See the description
of the third argument of the .Dt macro in the mdoc(7) manual.

That's a problem for manuals applying to multiple, but not all
architectures.  Those are faced will the ill choice of either
singling out one of their architectures or not specify any
architecture at all, in which case they look like applying to
any architecture.
In our tree, some manuals choose one way, some the other.

I fear that at some point, i will have to think about an extension
of the mdoc(7) language to solve that problem, to let a manual
specify more than one architecture it applies to.  But i'm still
postponing that, i don't consider the time ripe just yet.

> As an example, take pdisk in 5.5 RELEASE
> At http://www.openbsd.org/cgi-bin/man.cgi,
> a search for pdisk in All Architectures, macppc and i386
> will return the man page for pdisk.

Yes, and so does alpha or any other architecture.
That's because pdisk(8) chose the way of not specifying the
architecture at all, it says just:  .Dt PDISK 8
So it is treated as arch=any.

Now, for pdisk(8), that could be fixed, because if i understand
correctly, it actually is macppc only, so we could patch the
manual to say:  .Dt PDISK 8 macppc

But that won't work for some other pages.

That said, you also found a bug in makewhatis(8).
I just fixed that by the commit appended below.
Thanks for the report.

I cannot easily re-run makewhatis(8) on the OpenBSD webserver,
but i checked that the fix works by applying it here:

  http://mdocml.bsd.lv/cgi-bin/man.cgi

That's now closer to your expectation, right?

Yours,
  Ingo


P.S.
tedu@ said:
> The web interface has some peculiarities.  It can be helpful, but
> it doesn't quite reflect the man pages you will see on any actual
> OpenBSD system.

I think it's safe to say that at least some of these "peculiarities"
can be called "bugs".  Having both do the same, whatever is sanest,
is a goal i'm working on.

espie@ said:
> arch-dependent manpages are currently somewhat obvious in apropos,
> but not elsewhere.  I expect Ingo's work on man/mandoc merges will
> make this obvious everywhere.

If i manage to get on with the man/mandoc merge, the behaviour of
man(1) and apropos(1) will become more similar, yes.  I will have
to pay attention, though, that we get the best of both worlds
whereever possible, not the least common denominator - or something
random that happens to be easiest to implement.  I have opened a
couple of cans and am in the process of sorting the worms.


Log Message:
-----------
Do not report a page as arch=any merely because .Dt lacks the third argument.
Pages found outside arch-specific dirs still get arch=any, of course.
Issue reported by justinhenryhaynes at gmail dot com on misc@, thanks!

Modified Files:
--------------
    mdocml:
        mandocdb.c

Revision Data
-------------
Index: mandocdb.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mandocdb.c,v
retrieving revision 1.163
retrieving revision 1.164
diff -Lmandocdb.c -Lmandocdb.c -u -p -r1.163 -r1.164
--- mandocdb.c
+++ mandocdb.c
@@ -1196,8 +1196,8 @@ mpages_merge(struct mchars *mc, struct m
                if (mpage->mlinks->gzip)
                        mpage->form |= FORM_GZ;
                putkey(mpage, mpage->sec, TYPE_sec);
-               putkey(mpage, '\0' == *mpage->arch ?
-                   any : mpage->arch, TYPE_arch);
+               if (*mpage->arch != '\0')
+                       putkey(mpage, mpage->arch, TYPE_arch);
 
                for (mlink = mpage->mlinks; mlink; mlink = mlink->next) {
                        if ('\0' != *mlink->dsec)
--
 To unsubscribe send an email to [email protected]

Reply via email to