Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Jan 2012 17:41:01 -0600
From:      Paul Schmehl <pschmehl_lists@tx.rr.com>
To:        freebsd-ports@FreeBSD.org
Subject:   Re: How to detect the version of a installed perl module during portbuild
Message-ID:  <CE503C49DD251ECD02D0F7E1@utd71538.utdallas.edu>
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 January 3, 2012 9:52:15 PM +0100 Olli Hauer <ohauer@FreeBSD.org> 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*
> ...................................................^^^^^^^^^^^^^^
>

This returns the installed package:

pkg_info -qa | grep "p5-JSON-RPC" | sort | uniq

so maybe you could do something like?

JSON_VER=`pkg_info -qa | grep "p5-JSON-RPC" | sort | uniq | cut -d'-' -f4`

.if ${JSON_VER} >= 1
  do this
.else
  do this
.endif

-- 
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
*******************************************
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson
"There are some ideas so wrong that only a very
intelligent person could believe in them." George Orwell




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CE503C49DD251ECD02D0F7E1>