12

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.

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. 

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.

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

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

brian d foy
  • 129,424
  • 31
  • 207
  • 592
Joakim
  • 121
  • 1
  • 1
  • 3
  • Alien::SVN is not meant to be used, only installed. How did you install Alien::SVN and where did it get installed to? If you installed it properly, you should have SVN::Client. – runrig Mar 31 '10 at 16:27
  • run the following as root: updatedb && locate SVN/Client.pm – xenoterracide Apr 27 '10 at 21:09

4 Answers4

8

Install the package subversion-perl.

daxim
  • 39,270
  • 4
  • 65
  • 132
3

Follow following steps to install Alien-SVN module on you system:

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

2) Untar the file using taz-zxf <Package_name>

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

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

6) It will ask for some options

7) It will ask whether you would like to pass some arguments to configure. Give arguments as follows

--with-apr=<path_where_you_chechek_out_apr> --with-apr-util=<path_where_you_chechek_out_apr-util>

8) After successfully running Build.PL, run ./Build Alien-SVN-v1.6.12.1 directory.

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

10) Run following commands: perl Makefile.PL make make install

11) This will install Alien-SVN on your system :)

AnonGeek
  • 7,408
  • 11
  • 39
  • 55
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.

Richard Simões
  • 12,401
  • 6
  • 41
  • 50
  • The latest version of Alien::SVN http://search.cpan.org/~mschwern/Alien-SVN-v1.8.11.0/lib/Alien/SVN.pm uses subversion 1.8.11 from December 2014 – AdamS Jun 02 '17 at 07:09
-4
cpan> install SVN::Client 
Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335
  • cpan> install SVN::Client CPAN: Storable loaded ok Going to read /root/.cpan/Metadata Database was generated on Sun, 28 Mar 2010 16:57:52 GMT Warning: Cannot install SVN::Client, don't know what it is. Try the command i /SVN::Client/ to find objects with matching identifiers. cpan> As you see it says that it cant find anything name SVN::Client – Joakim Mar 31 '10 at 12:29
  • Sorry for the messy layout, but in short. Cannot install SVN::Client, don't know what it is. – Joakim Mar 31 '10 at 12:31