I want to use the SVN::Client cpan module to check out code from a repository.
我想使用SVN :: Client cpan模块来检查存储库中的代码。
But how to install and use this module? The documentation is kind of no existing.
但是如何安装和使用这个模块?文档有点不存在。
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安装Alien :: SVN模块并自己构建它。它似乎安装好了。没有错误消息,当我再次进入cpan并执行以下操作时,它表明已安装Alien :: SVN模块。
cpan> install Alien::SVN
Alien::SVN is up to date.
Here is my class that uses the SVN::Client:
这是我使用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.
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?
有没有人有一个代码的工作示例,或一个有用的提示,使Alien :: SVN / SVN :: Client工作?
4 个解决方案
#1
8
Install the package subversion-perl
.
安装包subversion-perl。
#2
3
Follow following steps to install Alien-SVN module on you system:
按照以下步骤在您的系统上安装Alien-SVN模块:
1) Download the latest Alien-SVN module from CPAN http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Alien-SVN-v1.6.12.1.tar.gz
1)从CPAN下载最新的Alien-SVN模块http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Alien-SVN-v1.6.12.1.tar.gz
2) Untar the file using taz-zxf <Package_name>
2)使用taz-zxf
3) cd Alien-SVN-v1.6.12.1
3)cd Alien-SVN-v1.6.12.1
4) The Apache Portable Runtime is required by the Alien-SVN. To download APR and APR-Util run time run the following commands while inside Alien-SVN-v1.6.12.1 directory
4)Alien-SVN需要Apache Portable Runtime。要下载APR和APR-Util运行时,请在Alien-SVN-v1.6.12.1目录中运行以下命令
svn co http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x \apr
svn co http://svn.apache.org/repos/asf/apr/apr-util/branches/1.2.x \apr-util
5) Now run perl Build.PL
which is inside Alien-SVN-v1.6.12.1 directory
5)现在运行Perl Build.PL,它位于Alien-SVN-v1.6.12.1目录中
6) It will ask for some options
6)它会要求一些选择
7) It will ask whether you would like to pass some arguments to configure. Give arguments as follows
7)它会询问您是否要传递一些参数来配置。给出如下参数
--with-apr=<path_where_you_chechek_out_apr> --with-apr-util=<path_where_you_chechek_out_apr-util>
--with-apr =
8) After successfully running Build.PL, run ./Build
Alien-SVN-v1.6.12.1 directory.
8)成功运行Build.PL后,运行./Build Alien-SVN-v1.6.12.1目录。
9) After running ./Build
, successfully, open native
directory which is located as Alien-SVN-v1.6.12.1/src/subversion/subversion/bindings/swig/perl/native
9)运行./Build后,成功打开本机目录,该目录位于Alien-SVN-v1.6.12.1 / src / subversion / subversion / bindings / swig / perl / native
10) Run following commands: perl Makefile.PL
make
make install
10)运行以下命令:perl Makefile.PL make make install
11) This will install Alien-SVN on your system :)
11)这将在您的系统上安装Alien-SVN :)
#3
2
As best I can tell, Alien::SVN and its constituent modules are no longer maintained. The subversion binary it compiles is extremely old (1.4, circa 2006). You may be better off piping to a pre-installed (and up-to-date) binary.
据我所知,Alien :: SVN及其组成模块已不再维护。它编译的颠覆二进制文件非常陈旧(1.4,大约2006年)。您可能最好不要使用预先安装(并且是最新的)二进制文件。
#4
-4
cpan> install SVN::Client
#1
8
Install the package subversion-perl
.
安装包subversion-perl。
#2
3
Follow following steps to install Alien-SVN module on you system:
按照以下步骤在您的系统上安装Alien-SVN模块:
1) Download the latest Alien-SVN module from CPAN http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Alien-SVN-v1.6.12.1.tar.gz
1)从CPAN下载最新的Alien-SVN模块http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/Alien-SVN-v1.6.12.1.tar.gz
2) Untar the file using taz-zxf <Package_name>
2)使用taz-zxf
3) cd Alien-SVN-v1.6.12.1
3)cd Alien-SVN-v1.6.12.1
4) The Apache Portable Runtime is required by the Alien-SVN. To download APR and APR-Util run time run the following commands while inside Alien-SVN-v1.6.12.1 directory
4)Alien-SVN需要Apache Portable Runtime。要下载APR和APR-Util运行时,请在Alien-SVN-v1.6.12.1目录中运行以下命令
svn co http://svn.apache.org/repos/asf/apr/apr/branches/1.2.x \apr
svn co http://svn.apache.org/repos/asf/apr/apr-util/branches/1.2.x \apr-util
5) Now run perl Build.PL
which is inside Alien-SVN-v1.6.12.1 directory
5)现在运行Perl Build.PL,它位于Alien-SVN-v1.6.12.1目录中
6) It will ask for some options
6)它会要求一些选择
7) It will ask whether you would like to pass some arguments to configure. Give arguments as follows
7)它会询问您是否要传递一些参数来配置。给出如下参数
--with-apr=<path_where_you_chechek_out_apr> --with-apr-util=<path_where_you_chechek_out_apr-util>
--with-apr =
8) After successfully running Build.PL, run ./Build
Alien-SVN-v1.6.12.1 directory.
8)成功运行Build.PL后,运行./Build Alien-SVN-v1.6.12.1目录。
9) After running ./Build
, successfully, open native
directory which is located as Alien-SVN-v1.6.12.1/src/subversion/subversion/bindings/swig/perl/native
9)运行./Build后,成功打开本机目录,该目录位于Alien-SVN-v1.6.12.1 / src / subversion / subversion / bindings / swig / perl / native
10) Run following commands: perl Makefile.PL
make
make install
10)运行以下命令:perl Makefile.PL make make install
11) This will install Alien-SVN on your system :)
11)这将在您的系统上安装Alien-SVN :)
#3
2
As best I can tell, Alien::SVN and its constituent modules are no longer maintained. The subversion binary it compiles is extremely old (1.4, circa 2006). You may be better off piping to a pre-installed (and up-to-date) binary.
据我所知,Alien :: SVN及其组成模块已不再维护。它编译的颠覆二进制文件非常陈旧(1.4,大约2006年)。您可能最好不要使用预先安装(并且是最新的)二进制文件。
#4
-4
cpan> install SVN::Client