最新消息:

making git-svn work on mac tiger

git admin 4438浏览 0评论

 http://www.mikeheijmans.com/2008/04/make-git-svn-work-on-mac-osx-tiger/

After a few hours of googling and pull some hair out, I have finally figured out how to make git-svn work on Mac OSX 10.4 Tiger. If you have installed git on your Mac using mac-ports or source, you will find that running git-svn causes an error similar to this:

Can't locate SVN/Core.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.6/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl /sw/lib/perl5 /sw/lib/perl5/darwin /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at /usr/bin/git-svn line 24.

This is because when you installed SVN it didn’t put the perl modules in the correct place. Here is a quick way to fix it.

mike@mikes-laptop$ locate SVN/Core.pm
In my case it was located in /usr/local/lib/svn-perl/SVN/Core.pm
Now we need to link that SVN directory in to your perl directory so perl can pick it up and use it. We will put it in /System/Library/Perl/Extras/5.8.6
mike@mikes-laptop$ sudo ln -s /usr/local/lib/svn-perl/SVN /System/Library/Perl/Extras/5.8.6/SVN

Now if you run git-svn you will notice a different error that resembles this:

Can't locate loadable object for module SVN::_Core in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.6/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl /sw/lib/perl5 /sw/lib/perl5/darwin /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at /System/Library/Perl/Extras/5.8.6/SVN/Base.pm line 59
BEGIN failed--compilation aborted at /System/Library/Perl/Extras/5.8.6/SVN/Core.pm line 5.
Compilation failed in require at /usr/bin/git-svn line 24.

We just need to link the auto/svn directory as well. Use the prior base path but instead of SVN you use auto/svn. Like so:

mike@mikes-laptop$ sudo ln -s /usr/local/lib/svn-perl/auto/svn /System/Library/Perl/Extras/5.8.6/auto/svn

And there you have it. If you try running git-svn you should be presented with an available command list.

http://www.mikeheijmans.com/2008/04/trouble-commiting-using-git-svn-mac-osx-tiger/

recently ported the toobs project from sourceforge (SVN) to github (git). So in order to do this I had to get git-svn to work. So with my last post I showed how I got the application to run, however, if you try and commit changes back to svn (git-svn dcommit) you will most likely end up with this error:

Password for 'mike': Can't locate Term/ReadKey.pm in @INC (@INC contains: /usr/local/lib/perl5/site_perl/5.8.6/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.8.6 /usr/local/lib/perl5/site_perl /System/Library/Perl/5.8.6/darwin-thread-multi-2level /System/Library/Perl/5.8.6 /Library/Perl/5.8.6/darwin-thread-multi-2level /Library/Perl/5.8.6 /Library/Perl /Network/Library/Perl/5.8.6/darwin-thread-multi-2level /Network/Library/Perl/5.8.6 /Network/Library/Perl /System/Library/Perl/Extras/5.8.6/darwin-thread-multi-2level /System/Library/Perl/Extras/5.8.6 /Library/Perl/5.8.1 .) at /usr/bin/git-svn line 2272.

This is because git-svn needs the ReadKey perl module to be able to read the server’s key to encrypt the password before it sends the password to the server. (wouldn’t want to be sending passwords in plain text across the internet would you?). Here is the solution:

Pull up the CPAN teminal:
perl -MCPAN -e shell
You may need to set it up if you have never used it…. just use defaults if you are not sure

Once at the cpan prompt install the needed module:
cpan> install Term::ReadKey

once it is finished go ahead and quit the cpan terminal and you should be able to run git-svn dcommit and everything should be peachy

转载请注明:爱开源 » making git-svn work on mac tiger

您必须 登录 才能发表评论!