Tcl:正在安装包 starkit?

Tcl:正在安装包 starkit?

(只是想记录这一点;随后是自我回答)

我刚刚发现Visual REGEXP:正则表达式的图形浏览器,这是一个 Tck/Tk 应用程序,所以我想在 Ubuntu 11.04 natty 上试用它。

首先我尝试了 3.0 版本:

$ wget http://laurent.riesterer.free.fr/regexp/visual_regexp-3.0.tar.gz
$ tar xzvf visual_regexp-3.0.tar.gz
$ cd visual_regexp-3.0/
$ ./visual_regexp.tcl 
./visual_regexp.tcl: 48: Syntax error: word unexpected (expecting ")")
$ bash visual_regexp.tcl 
visual_regexp.tcl: line 48: syntax error near unexpected token `platform'
visual_regexp.tcl: line 48: `if {$tcl_platform(platform) == "windows"} {'
$ sh visual_regexp.tcl 
visual_regexp.tcl: 48: Syntax error: word unexpected (expecting ")")
$ tclsh visual_regexp.tcl 
0
invalid command name "toplevel"
    while executing
"toplevel .history"
    (procedure "regexp::history:init" line 5)
    invoked from within
"regexp::history:init"
    (file "visual_regexp.tcl" line 1080)
$ wish visual_regexp.tcl      # finally works
$ readlink -f $(which wish)
/usr/bin/wish8.4
$ wish8.5 visual_regexp.tcl   # works too, better fonts
$ cd ..

好的,现在我想尝试 3.1 版本:

$ wget http://laurent.riesterer.free.fr/regexp/visual_regexp-3.1.tcl
$ wish8.4 visual_regexp-3.1.tcl
Error in startup script: can't find package starkit
    while executing
"package require starkit"
    (file "visual_regexp-3.1.tcl" line 1)
$ tclsh visual_regexp-3.1.tcl
can't find package starkit
    while executing
"package require starkit"
    (file "visual_regexp-3.1.tcl" line 1)

寻找这个错误,我能找到的最相关的结果是:

构建你的第一个 Starkit

步骤 1:获取 Tclkit 和 sdx
[...]
如果此命令响应错误“找不到包 starkit”,则需要向 tclkit 二进制文件添加读取权限。在 UNIX/Linux 类型的系统上,可以通过以下方式执行:chmod u+r tclkit

好的...首先我以为有一个适用于此的 Ubuntu 包tclkit,但是找不到;所以最终这样做:

$ wget http://tclkit.googlecode.com/files/tclkit-8.5.9-linux-ix86.gz
$ gzip -d tclkit-*.gz
$ chmod +x tclkit-8.5.9-linux-ix86
$ sudo ln -s $(readlink -f ./tclkit-8.5.9-linux-ix86) /usr/bin/
$ which tclkit
/usr/bin/tclkit
$

$ wget http://tclkit.googlecode.com/files/sdx-20110317.kit
$ chmod +x sdx-20110317.kit
$ sudo ln -s $(readlink -f ./sdx-20110317.kit) /usr/bin/sdx.kit
$ which sdx.kit
/usr/bin/sdx.kit

$ tclkit sdx.kit
couldn't read file "sdx.kit": no such file or directory

$ tclkit $(which sdx.kit)
Specify one of the following commands:
 addtoc    eval      fetch     ftpd      httpd     httpdist  ls        lsk       md5sum    mkinfo    mkpack    mkshow    mksplit   mkzipkit  qwrap     ratarx    rexecd    starsync  sync      tgz2kit   treetime  unwrap    update    version   wrap
For more information, type:  /usr/bin/sdx.kit help ?command?

$ tclkit visual_regexp-3.1.tcl
0
invalid command name "toplevel"
    while executing
"toplevel .history"
    (procedure "regexp::history:init" line 5)
    invoked from within
"regexp::history:init"
    (file "visual_regexp-3.1.tcl" line 1510)

$ wish8.4 visual_regexp-3.1.tcl
Error in startup script: can't find package starkit
    while executing
"package require starkit"
    (file "visual_regexp-3.1.tcl" line 1)
$ tclsh visual_regexp-3.1.tcl
can't find package starkit
    while executing
"package require starkit"
    (file "visual_regexp-3.1.tcl" line 1)

显然我已经可以tclkit运行sdx.kit了 - 但仍然无法visual_regexp-3.1.tcl运行?如何在 Ubuntu 上运行它?

答案1

答案:丢失的是tclvfs包裹。

也就是说,在经历了这一切之后,我尝试查找visual_regexp-3.1.tcl- 并意识到有一个适用于它的 Ubuntu 软件包。所以我做了

$ sudo apt-get install visual-regexp
The following extra packages will be installed:
  tclvfs
...
The following NEW packages will be installed:
  tclvfs visual-regexp
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 136 kB of archives.
After this operation, 590 kB of additional disk space will be used.
Do you want to continue [Y/n]? ...

$ which visual-regexp
/usr/bin/visual-regexp

在此之后,两者都visual-regexp可以正常工作,并且wish8.5 visual_regexp-3.1.tcl;但是,请注意visual_regexp-3.1.tcl不适用于wish8.4

$ wish8.4 visual_regexp-3.1.tcl 
0
Error in startup script: unknown option "-tristatevalue"
    while executing
"checkbutton    .top.regexp.options.$option  -text              $label   -borderwidth   1   -underline      $underline  -variable       regexp::data(v:$option)  -offvalue      "" ..."
    (procedure "regexp::gui" line 33)
    invoked from within
"regexp::gui"
    (file "visual_regexp-3.1.tcl" line 1511)

最后,请注意visual_regexp-3.1.tcl显然仍标记为 3.0:

visual_regexp-3.1.tcl

相关内容