Re: [PATCH] configure.ac: Add mandoc as valid formatter

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



Hi,

Wolfgang Mueller wrote on Sat, May 04, 2019 at 07:31:23PM +0200:

> On systems that have mandoc installed but are missing an nroff binary,
> the configure script will fall back to pre-formatted manual pages
> despite the fact that mandoc could be used.
> 
> The proposed patch adds mandoc as a valid formatter to configure.ac. As
> mandoc supports the -mdoc flag, it can simply be added to the list of
> nroff-like binaries.

Thanks for reporting.  I agree very much with the principle.  Strange
no one from Void Linux or Alpine Linux reported this issue before...

> diff --git a/configure.ac b/configure.ac
> index 9022ee9c..813b7fa2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -4627,7 +4627,7 @@ AC_ARG_WITH([mantype],
>  )
>  if test -z "$MANTYPE"; then
>  	TestPath="/usr/bin${PATH_SEPARATOR}/usr/ucb"
> -	AC_PATH_PROGS([NROFF], [nroff awf], [/bin/false], [$TestPath])
> +	AC_PATH_PROGS([NROFF], [mandoc nroff awf], [/bin/false], [$TestPath])
>  	if ${NROFF} -mdoc ${srcdir}/ssh.1 >/dev/null 2>&1; then
>  		MANTYPE=doc
>  	elif ${NROFF} -man ${srcdir}/ssh.1 >/dev/null 2>&1; then

However, i'd suggest

	AC_PATH_PROGS([NROFF], [nroff mandoc awf], ...

Otherwise, you get this strange output from ./configure
when both are installed, needlessly confusing users:

	checking for nroff... /usr/local/bin/nroff
	checking for mandoc... /usr/bin/mandoc
	[...]
	checking for mandoc... (cached) /usr/local/bin/nroff

The reason for this confusing output is that the first and the last of
these lines both use the variable NROFF, so they should also better
log "checking for nroff...", hence let's keep nroff first.
The final value of the NROFF variable doesn't matter, it isn't used
for anything in the build.

Now arguably, it's a mess that the NROFF variable is used for two
different purposes with two different definitions - the first while
figuring out MANFMT which is only used in a maintainer target, the
second while figuring out MANTYPE, and that, even though the definitions
are different, the second uses the cached value from the first if the
first succeeded.

But i guess when people the sell their soul to the devil of autohell,
the result is always a mess.  Someone should clean it up, but that
is *very hard* to do because autohell is such incredibly stupid
software.  I'm certainly not volunteering.

For the immediate bugfix, the above seems sufficient.

Yours,
  Ingo
_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev



[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux