为什么 Cygwin CVS 无法读取 Ruby/Perl 脚本中的 CVS 密码文件?

发布于 2024-08-05 03:52:30 字数 932 浏览 5 评论 0原文

在 Windows 命令行和 cygwin bash 上,我可以毫无问题地执行以下命令:

cvs login
cvs -Q log -N -rVersion_01_00

同一目录中的 ruby​​ 脚本包含以下内容:

`cvs login`;
`cvs -Q log -N -rVersion_01_00`;

当我在 Windows 命令行上执行 ruby​​ 脚本时,出现以下错误:

cvs log: warning: failed to open /cygdrive/c/Documents and Settings/za100744/.cvspass for reading: No such file or directory

如果我在在 cygwin bash shell 中,我得到的输出与手动输入命令时的输出相同。

我不知道出了什么问题。 Ruby 脚本生成的路径是错误的,因为它是 cygwin 路径,但它直接在命令行上工作正常。我使用作为 cygwin 一部分提供的 cvs:

which cvs
cvs is an external : C:\cygwin\bin\cvs.exe

Ruby 是一键安装程序版本:

which ruby
/cygdrive/c/Ruby/bin/ruby

Ruby 下的 cvs 似乎无法将 /cygdrive/c 解析为 c:,但可以从 cmdline 正常工作。

Perl 给了我完全相同的问题。

my $str = "cvs -Q log -N -r$cvs_tag|";
open(CVS_STATUS, $str) or die "\n##ERROR##";

On the Windows command line and cygwin bash I can execute the following without problems:

cvs login
cvs -Q log -N -rVersion_01_00

A ruby script in the same directory contains the following:

`cvs login`;
`cvs -Q log -N -rVersion_01_00`;

When I execute the ruby script on the Windows command line I get the following error:

cvs log: warning: failed to open /cygdrive/c/Documents and Settings/za100744/.cvspass for reading: No such file or directory

If I run the script in a cygwin bash shell I get the same output I would as when I type in the commands manually.

I have no idea as to what is going wrong. The path generated by the Ruby script is wrong since it is a cygwin path but it works correctly directly on the command line. I use cvs that came as part of cygwin:

which cvs
cvs is an external : C:\cygwin\bin\cvs.exe

Ruby is the one-click installer version:

which ruby
/cygdrive/c/Ruby/bin/ruby

It seems like cvs under Ruby can not resolve /cygdrive/c to c: but works OK from the cmdline.

Perl gives me exactly the same problem.

my $str = "cvs -Q log -N -r$cvs_tag|";
open(CVS_STATUS, $str) or die "\n##ERROR##";

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

岁月染过的梦 2024-08-12 03:52:30

看来 CVS 无法创建该文件,或者您的路径错误。文件 .cvspass 是否存在?如果没有,此页面建议您尝试创建一个空的 < code>.cvspass 文件,然后运行您的命令。例如 do

touch ~/.cvspass

如果这没有帮助,那么问题可能与路径相关。有几种可能性; $HOME 设置不正确,您的主目录与 \etc\passwd 中的内容不匹配等。请参阅 本教程提供了一些有助于确定问题的故障排除步骤。

It looks like either CVS can't create the file, or your path is wrong. Does the file .cvspass exist? If not, this page suggests you try creating an empty .cvspass file and then run your command. e.g. do

touch ~/.cvspass

If this doesn't help, then the problem is probably path related. There are a few possibilities; $HOME not set correctly, your home dir not matching what's in \etc\passwd, etc. See this tutorial for some troubleshooting steps that should help pin down the problem.

像极了他 2024-08-12 03:52:30

使用windows本机编译的CVS解决了这个问题。这并不理想,因为我必须向拥有 cygwin CVS 的用户发送带有脚本的 cvs 可执行文件,但总比没有好。

Using a windows native compiled CVS solves the problem. It is not ideal since I have to send a cvs executable with the script for users that has cygwin CVS but its better than nothing.

待"谢繁草 2024-08-12 03:52:30

我们在基于 cygwin 的 Perl 脚本和内置工具(例如 rsync)中的 UNIX、混合和 Windows 样式路径方面遇到了一些问题。例如,rsync 无法处理风式路径。使用工具“cygpath.exe”正确调整它们。也许这就是原因。

We had several problems with unix-, mixed- and windows-style paths in cygwin based perl scripts and built-in tools such as rsync. E.g. rsync can't handle wind-style paths. Use the tool "cygpath.exe" to adjust them correctly. Maybe it's the cause.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文