[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Problem with SVN::Client perl module

From: Ben Reser <ben_at_reser.org>
Date: 2003-12-17 04:57:38 CET

On Tue, Dec 16, 2003 at 07:58:03PM -0500, Garrett Rooney wrote:
> So I've been playing with the Perl bindings lately, and I've been
> having some trouble with the SVN::Client module. When I import it I
> get the following error:
>
> $ cat foo.pl
> use SVN::Core;
> use SVN::Client;
> $ perl foo.pl
> Usage: svn_client_import(path,url,nonrecursive,ctx,pool); at foo.pl
> line 2.
> BEGIN failed--compilation aborted at foo.pl line 2.
> $
>
> The problem turns out to be in Base.pm. We redefine the 'import'
> function so that we set up the perl version of svn_client_import, and
> it blows up later on when we try to call the perl import subroutine.
> I'm currently using the following hack to work around it, but I'm
> pretty sure it's the wrong solution...
>
> Index: Base.pm
> ===================================================================
> --- Base.pm (revision 8017)
> +++ Base.pm (working copy)
> @@ -76,6 +76,7 @@
> elsif (m/(.*)_set$/) {
> }
> else {
> + if ($_ eq "import") { $_ = "do_import"; }
> *{"${caller}::$_"} = ${"SVN::_${pkg}::"}{$name};
> }
> }
>
> Any thoughts from the Perl gurus out there?

Yeah I was aware of this I just hadn't tracked this issue down yet.
I think the best way would be to wrap the import function so that it
detects how it's being called (as an import from use or as import for
subversion). Shouldn't be hard to detect. Calls to the real svn import
function will always start with a ref blessed as
'_p_svn_client_commit_info_t'. Also once we move to the OO style calls
we'll have the ctx as the first item.

I can't imagine a scenario where someone would pass such a ref to use.

So it's on my fix list. I just need to finish up this prompt stuff and
then I'll look at it.

-- 
Ben Reser <ben@reser.org>
http://ben.reser.org
"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Dec 17 04:59:00 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.