Date: Wed, 04 Jan 2012 13:00:15 +0100 From: Olli Hauer <ohauer@FreeBSD.org> To: freebsd-ports <freebsd-ports@FreeBSD.org> Subject: Re: How to detect the version of a installed perl module during portbuild Message-ID: <4F043F4F.2070107@FreeBSD.org> In-Reply-To: <4F036A7F.1000908@FreeBSD.org> References: <4F036A7F.1000908@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On 2012-01-03 21:52, Olli Hauer wrote: > Hi, > > I'm searching a solution to detect the version of p5-JSON-RPC during build time. > > JSON-RPC-1.01 is *not* backward compatible to 0.96 so I have to apply a fix to the port only if JSON-RPC > 0.96 is installed. > > >>From http://cpansearch.perl.org/src/DMAKI/JSON-RPC-1.01/Changes > 1.00_01 2011 Nov 16 > - If you are using old JSON::RPC code (up to 0.96), DO NOT EXPECT > YOUR CODE TO WORK. THIS VERSION IS BACKWARDS *INCOMPATIBLE* > ...................................................^^^^^^^^^^^^^^ > Thanks for all the suggestions ;) Meanwhile the following solutions was suggested from upstream (will be implemented as patch in the port) -use base qw(JSON::RPC::Server::CGI); +BEGIN { + eval { require JSON::RPC::Server::CGI; }; + if ($@) { + require JSON::RPC::Legacy::Server::CGI; + our @ISA = qw(JSON::RPC::Legacy::Server::CGI); + } + else { + our @ISA = qw(JSON::RPC::Server::CGI); + } +} -- olli
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F043F4F.2070107>