Ctags: rst2man:错误:没有这样的选项:--syntax-highlight

创建于 2019-12-15  ·  15评论  ·  资料来源: universal-ctags/ctags

debian8 安装失败
without-doc参数不见了

Already on 'master'
Your branch is up to date with 'origin/master'.
HEAD is now at f7513be Merge pull request #2373 from pragmaware/fix-bug-2364-attempt-2
==> ./autogen.sh
==> ./configure --prefix=home/ouyangsong/.linuxbrew/Cellar/universal-ctags/HEAD-f7513be
==> make
Last 15 lines from /data02/home/ouyangsong/.cache/Homebrew/Logs/universal-ctags/03.make:
  rst2man [options] [<source> [<destination>]]

rst2man: error: no such option: --syntax-highlight
Makefile:5771: recipe for target 'man/tags.5' failed
make[1]: *** [man/tags.5] Error 2
Usage
=====
  rst2man [options] [<source> [<destination>]]

rst2man: error: no such option: --syntax-highlight
Makefile:5769: recipe for target 'man/ctags.1' failed
make[1]: *** [man/ctags.1] Error 2
make[1]: Leaving directory '/tmp/universal-ctags-20191215-3061613-15gdbok'
Makefile:1266: recipe for target 'all' failed
make: *** [all] Error 2
BUILDSYS|git operation|workflow|test harness

最有用的评论

我不知道 linuxbrew。 不过,这种行为是可以理解的。
我认为这样一个工具的构建过程不应该依赖于它的用户定制的环境。

无论如何,我在 #2375 中修复了这个问题。 #2376 合并后我会合并它。

所有15条评论

您的 rst2man 可能太旧了。
https://sourceforge.net/p/docutils/patches/141/

我认为这是 ctags 构建系统的问题。

我将最后一个 docutils 和别名 rst2man 安装到最新的 rst2man,仍然无法正常工作。

$ pip install --user --upgrade docutils
$ alias rst2man=//home/ouyangsong/.local/bin/rst2man.py
$ rst2man --version
rst2man.py (Docutils 0.15.2 [release], Python 2.7.9, on linux2)

alias仅适用于您的外壳。 创建一个符号链接怎么样?

默认的 rst2man 在/usr/bin ,但我没有 root。
我尝试添加 $PATH,仍然没有工作。 @k-takata 你的意思是 rst2man 正在运行是一个子进程,所以在子进程中 rst2man 太旧了。

对不起,我误解了你的问题。
我想知道rst2man --versionrst2man --help | grep highlight

下面是一个例子:

[yamato@slave]~/var/ctags-github/man% rst2man --version
rst2man --version
rst2man (Docutils 0.14, Python 2.7.15, on linux2)
[yamato@slave]~/var/ctags-github/man% rst2man --help | grep highlight
rst2man --help | grep highlight
--syntax-highlight=<format>

我猜你的 rst2man 没有 --syntax-highlight。
如果我的猜测是正确的,下面的补丁可能会解决这个问题。

diff --git a/man/Makefile b/man/Makefile
index ec43caa2..42d911d4 100644
--- a/man/Makefile
+++ b/man/Makefile
@@ -25,7 +25,9 @@ RST2PDF  = rst2pdf

 # rst2man had a bug about code-block:: handling.
 # https://sourceforge.net/p/docutils/patches/141
-RST2MAN_FLAGS = --syntax-highlight=none
+RST2MAN_FLAGS = $(shell if $(RST2MAN) --help | grep -q -e --syntax-highlight; then \
+               echo --syntax-highlight=none; \
+           fi)
 RST2HTML_FLAGS =
 RST2PDF_FLAGS =

@masatake是的,你的猜测是对的。 /usr/bin的 rst2man 没有语法高亮。

$ rst2man --help | grep -q -e --syntax-highlight
$ /usr/bin/rst2man --version
rst2man (Docutils 0.8.1 [release], Python 2.7.9, on linux2)

我没有 root 创建符号链接或升级它,所以我使用 linuxbrew install ctags 的依赖项,然后按照https://github.com/universal-ctags/ctags/blob/master/docs/autotools.rst安装到$HOME/.local ,终于成功了。
但奇怪的是,在我创建符号链接“$HOME/.local/bin/rst2man -> $HOME/.local/bin/”后,linuxbrew 没有使用$HOME/.local的 rst2man,而是使用/usr/bin/rst2man rst2man.py”并添加 $PATH。 我猜 linuxbrew 使用了一个不使用我的 $PATH 的 shell 子进程

我不知道 linuxbrew。 不过,这种行为是可以理解的。
我认为这样一个工具的构建过程不应该依赖于它的用户定制的环境。

无论如何,我在 #2375 中修复了这个问题。 #2376 合并后我会合并它。

我合并了#2375。 @songouyang ,你能再试一次吗?

@masatake我再试一次,但失败了。 我想也许你修复了 man/makefile 中的 rst2man 选项,但忘记了 makefile 中的这一行。
https://github.com/universal-ctags/ctags/blob/ba26b8a744ab7af3842ba219d75c5dc845ba583e/Makefile.am#L232

==> make
Last 15 lines from /data02/home/ouyangsong/.cache/Homebrew/Logs/universal-ctags/03.make:
  rst2man [options] [<source> [<destination>]]

rst2man: error: no such option: --syntax-highlight
Makefile:5773: recipe for target 'man/ctags-incompatibilities.7' failed
make[1]: *** [man/ctags-incompatibilities.7] Error 2
Usage
=====
  rst2man [options] [<source> [<destination>]]

rst2man: error: no such option: --syntax-highlight
Makefile:5773: recipe for target 'man/ctags-optlib.7' failed
make[1]: *** [man/ctags-optlib.7] Error 2
make[1]: Leaving directory '/tmp/universal-ctags-20191217-3629840-z9svqb'
Makefile:1266: recipe for target 'all' failed
make: *** [all] Error 2

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
  https://github.com/universal-ctags/homebrew-universal-ctags/issues
5768 .1.rst.1:
5769         $(rst2man_verbose)$(RST2MAN) $(RST2MAN_OPTIONS) $< $@
5770 .5.rst.5:
5771         $(rst2man_verbose)$(RST2MAN) $(RST2MAN_OPTIONS) $< $@
5772 .7.rst.7:
5773         $(rst2man_verbose)$(RST2MAN) $(RST2MAN_OPTIONS) $< $@
1264 RST2MAN_OPTIONS = --syntax-highlight=none
1265 all: $(BUILT_SOURCES) config.h
1266         $(MAKE) $(AM_MAKEFLAGS) all-am

谢谢!
我会再提出一个拉取请求。

你能再试一次吗?

@masatake现在好了,谢谢你👍

感谢您的测试(以及关键建议)。

此页面是否有帮助?
0 / 5 - 0 等级

相关问题

blackb1rd picture blackb1rd  ·  8评论

sparkcanon picture sparkcanon  ·  3评论

fabiensabatie picture fabiensabatie  ·  3评论

lvc picture lvc  ·  8评论

jayceekay picture jayceekay  ·  13评论