m4宏是否可以使用shell$(...)
对变量进行重定向输出?变量$MANPAGE_DOCBOOK_XSL
为空:(.
if test "x${XMLCATALOG}" != "x" -a "x$have_xmlcatalog_file" = "xyes"; then
DOCBOOK_XSL_URI="http://docbook.sourceforge.net/release/xsl/current"
DOCBOOK_XSL_PATH="manpages/docbook.xsl"
MANPAGE_DOCBOOK_XSL=$(${XMLCATALOG} ${XML_CATALOG_FILE} ${DOCBOOK_XSL_URI}/${DOCBOOK_XSL_PATH} | sed -n 's|^file:/+|/|p;q')
fi
https://github.com/pevik/ima-evm-utils/blob/master/m4/manpage-docbook-xsl.m4#L22
在Wayland中查看类似的代码,他们只是检查命令是否有效(是否可以找到目录(,但不检查值。
https://github.com/wayland-project/wayland/blob/master/configure.ac#L167
最后我发现它是错误的sed
部分(m4本身没有魔法(。我发送了一个修复软件的补丁:
https://patchwork.kernel.org/patch/11712861/
- MANPAGE_DOCBOOK_XSL=$(${XMLCATALOG} ... | sed -n 's|^file:/+|/|p;q')
+ MANPAGE_DOCBOOK_XSL=$(${XMLCATALOG} ... | sed 's|^file:/+|/|')
我想我应该删除这个无效的问题。