Subject: bin/8725: suggestions for bsd.{info,man}.mk for man pages generated from info
To: None <gnats-bugs@gnats.netbsd.org>
From: None <D.Thomas@cmcb.uq.edu.au>
List: netbsd-bugs
Date: 11/01/1999 06:19:33
>Number:         8725
>Category:       bin
>Synopsis:       suggestions for bsd.{info,man}.mk for man pages generated from info
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bin-bug-people (Utility Bug People)
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov  1 06:18:00 1999
>Last-Modified:
>Originator:     Danny Thomas
>Organization:
CMCB, The Uni of Queensland
>Release:        around 1.4K
>Environment:
NetBSD server.vthrc.uq.edu.au 1.4K NetBSD 1.4K (SERVER.v6) #0: Sun Oct 24 02:24:
47 EST 1999     root@server.vthrc.uq.edu.au:/usr/src/sys/arch/i386/compile/SERVE
R.v6 i386
>Description:
A person knowing our awk is really gawk might be slightly surprised to find "man gawk" returns nothing. It's really not that confusing because it is installed purely as awk. 

Q1: is there any reason not to link this binary as 'gawk' ?

Q2: it seems an attempt was started to have the man-page work
    either for 'awk' or for 'gawk', but there are some bugs
    preventing this

>How-To-Repeat:
man awk,
notice title says gawk(1)
man gawk
>Fix:
FIX 1
/usr/src/gnu/usr.bin/gawk/Makefile
needs gawk.1 added to the line
  MLINKS=   awk.1


FIX 2
the missing gawk.1 would have been announced had manlinks included a test at the end of the loop, as in:

manlinks: manpages
.if defined(MLINKS) && !empty(MLINKS)
        @set ${MLINKS}; \
        while test $$# -ge 2; do \
                name=$$1; \
                shift; \
                dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
                l=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
                name=$$1; \
                shift; \
                dir=${DESTDIR}${MANDIR}/man$${name##*.}; \
                t=$${dir}${MANSUBDIR}/$${name}${MCOMPRESSSUFFIX}; \
                if [ -z "${UPDATE}" -o ! -f $$t ]; then \
                    echo $$t -\> $$l; \
                    ln -f $$l $$t; \
                fi; \
        done; \
        if test $$# -eq 1; then \
                echo odd number in MLINKS; \
        fi;
.endif

or have I misunderstood the operation?


FIX 3
more importantly, /usr/share/mk/bsd.info.mk does not include handling of manlinks or catlinks. I'd suggest splitting off the code for these from bsd.man.mk into a new file, say bsd.man.util.mk, which gets included in both bsd.man.mk & bsd.info.mk.

Doing that produced an error msg at first because MLINKS only had an odd number of elements. Adding gawk.1 to MLINKS that saw both awk.1 & gawk.1 man-pages created.

I think this would only benefit gawk at the moment...

NB is there anything else that should get added to bsd.info.mk, in the way the tmac macros are in bsd.man.mk ?
>Audit-Trail:
>Unformatted: