The devmanual's Makefile runs things like prereq: @type -p convert &>/dev/null ... which works in bash: $ type -p convert /usr/bin/convert but not in e.g. dash: $ dash $ type -p convert -p: not found convert is /usr/bin/convert A workaround for this is to set SHELL = /bin/bash at the top of the Makefile, but it would be better to avoid the bashisms entirely.
Since the output from "type" is never used, it looks like the "-p" can simply be dropped without hurting anything.
Created attachment 569780 [details, diff] 0001-Makefile-remove-BASH-specific-type-p-and-idioms.patch This fixes the "type -p" thing, and also the "&>" shortcut that is bash-specific. The existing check is a little bit more broken than I originally thought, since the "&>" tricks Dash into returning success even when e.g. "convert" is not present. Of course the build just fails later on... but this patch should bring bash/dash to parity.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/proj/devmanual.git/commit/?id=ad73851922df05d91b9be52f41529014c3482113 commit ad73851922df05d91b9be52f41529014c3482113 Author: Michael Orlitzky <mjo@gentoo.org> AuthorDate: 2019-03-19 16:01:18 +0000 Commit: Brian Evans <grknight@gentoo.org> CommitDate: 2019-03-19 16:57:54 +0000 Makefile: remove BASH-specific "type -p" and "&>" idioms. The Makefile uses two "type -p" commands to determine if the "convert" and "xsltproc" commands are present. The "type" command itself is defined in POSIX, http://pubs.opengroup.org/onlinepubs/9699919799/utilities/type.html but the additional "-p" flag is BASH-specific. This can lead to unexpected behavior when the /bin/sh symlink that the Makefile uses by default points to a non-BASH shell: $ dash $ type -p convert -p: not found convert is /usr/bin/convert By chance, this is ultimately not fatal, but does cause the default target to output some confusing messages. And in fact the output from the "type -p" command is never used, which means that "type" itself should suffice, in any shell. Thus this commit drops the two "-p" arguments to "type". The same two "type" commands attempt to redirect both stdout and stderr to /dev/null using the BASH "&>" shortcut. This commit replaces it with the standard, but more verbose incantation ">/dev/null 2>&1" that is portable to other shells. Closes: https://bugs.gentoo.org/680932 Signed-off-by: Michael Orlitzky <mjo@gentoo.org> Signed-off-by: Brian Evans <grknight@gentoo.org> Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)