From owner-freebsd-ports@FreeBSD.ORG Wed Jan 4 01:08:38 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7A2BD106566C for ; Wed, 4 Jan 2012 01:08:38 +0000 (UTC) (envelope-from prvs=3434f3c49=pschmehl_lists@tx.rr.com) Received: from ip-002.utdallas.edu (ip-002.utdallas.edu [129.110.20.108]) by mx1.freebsd.org (Postfix) with ESMTP id 420878FC08 for ; Wed, 4 Jan 2012 01:08:37 +0000 (UTC) X-Group: None X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApIJADaRA0+BbgogVmdsb2JhbABDggWqdAEhAiQlgXIBAQQBOAJECwtGQxQZG4dfCLVIg32EeII3YwSIN58e X-IronPort-AV: E=Sophos;i="4.71,452,1320645600"; d="scan'208";a="81398874" Received: from zxtm01.utdallas.edu (HELO utd71538.utdallas.edu) ([129.110.10.32]) by ip-002.utdallas.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Jan 2012 17:41:02 -0600 Date: Tue, 03 Jan 2012 17:41:01 -0600 From: Paul Schmehl To: freebsd-ports@FreeBSD.org Message-ID: In-Reply-To: <4F036A7F.1000908@FreeBSD.org> References: <4F036A7F.1000908@FreeBSD.org> X-Mailer: Mulberry/4.1.0a1 (Mac OS X) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline; size=1274 Cc: Subject: Re: How to detect the version of a installed perl module during portbuild X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Paul Schmehl List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jan 2012 01:08:38 -0000 --On January 3, 2012 9:52:15 PM +0100 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* > ...................................................^^^^^^^^^^^^^^ > 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