如何安装Perl的SVN :: Client? [英] How do I install Perl's SVN::Client?

查看:157
本文介绍了如何安装Perl的SVN :: Client?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 SVN :: Client cpan模块从存储库中检出代码。

I want to use the SVN::Client cpan module to check out code from a repository.

但是如何安装和使用此模块?该文档不存在。

But how to install and use this module? The documentation is kind of no existing.

我尝试通过cpan安装Alien :: SVN模块并自行构建。
而且似乎可以安装。没有错误消息,当我再次进入cpan并执行以下操作时,它表明已安装Alien :: SVN模块。

I have tried install the Alien::SVN module both through cpan and build it myself. And it seems to install okay. No error messages, and when i go into cpan again and do the following it states that the Alien::SVN module is installed.

cpan> install Alien::SVN 
Alien::SVN is up to date. 

这是我的班级,使用SVN :: Client:

Here is my class that uses the SVN::Client:

use strict;
use warnings;
use Alien::SVN;
use SVN::Client;


sub new {
 my $self = {
  localpath => ''
 };
 bless($self);
 return $self;
}

sub update_repository{
 my ($self) = @_;

 my $svn = SVN::Client->new();
 return $svn->update($self->_getPath(), 'HEAD', 1);
}
sub _getPath{
 my ($self) = @_;
 return $self->{localpath};
}

因此,当我使用脚本来调用此类的更新存储库方法时,出现以下错误:

So when i use a script to call the update repository method of this class i get the following error:

Can't locate SVN/Client.pm in @INC (@INC contains: /opt/STS /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/site_perl/5.8.8 /usr/lib/perl5/site_perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux-thread-multi /
usr/lib/perl5/vendor_perl/5.8.8 /usr/lib/perl5/vendor_perl /usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi /usr/lib/perl5/5.8.8 .) at /opt/STS/svn.pm line 7.

我还尝试过更改使用SVN :: Client和使用Alien :: SVN的应用程序,但是运气不佳。

I have also tried changing use SVN::Client with use Alien::SVN but with no luck.

有人可以使用示例代码吗?或使Alien :: SVN / SVN :: Client工作的有用提示?

Does anyone have a working example of code, or a helpful tip to make the Alien::SVN / SVN::Client work?

推荐答案

安装软件包 subversion-perl

这篇关于如何安装Perl的SVN :: Client?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆