From owner-freebsd-ports@FreeBSD.ORG Tue Mar 6 21:06:21 2012 Return-Path: Delivered-To: freebsd-ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9E46A106566B for ; Tue, 6 Mar 2012 21:06:21 +0000 (UTC) (envelope-from ohauer@FreeBSD.org) Received: from p578be941.dip0.t-ipconnect.de (p578be941.dip0.t-ipconnect.de [87.139.233.65]) by mx1.freebsd.org (Postfix) with ESMTP id 5C2098FC18 for ; Tue, 6 Mar 2012 21:06:21 +0000 (UTC) Received: from [192.168.0.100] (cde1100.uni.vrs [192.168.0.100]) (Authenticated sender: ohauer) by p578be941.dip0.t-ipconnect.de (Postfix) with ESMTPSA id 43A7B1FBE8; Tue, 6 Mar 2012 22:06:18 +0100 (CET) Message-ID: <4F567C47.7080205@FreeBSD.org> Date: Tue, 06 Mar 2012 22:06:15 +0100 From: Olli Hauer User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 MIME-Version: 1.0 To: freebsd-ports@freebsd.org References: <4F567784.9090801@FreeBSD.org> In-Reply-To: X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Helmut Schneider Subject: Re: Problem with genplist replacing PORTVERSION X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-ports List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Mar 2012 21:06:21 -0000 On 2012-03-06 21:51, Helmut Schneider wrote: > Olli Hauer wrote: > >> On 2012-03-06 21:30, Helmut Schneider wrote: >>> Hi, >>> >>> To create a new version of a port (let's say typo3) I copy typo3 to >>> typo3.org. Then I run >>> >>> sudo make clean && sudo port fetch >>> sudo rm -r /tmp/typo3* >>> sudo genplist clean; sudo genplist create tmp >>> >>> As a result on my 8.2 machine $PORTVERSION in pkg-plist is replaced >>> with %%PORTVERSION%% as defined in the Makefile: >>> >>> %%WWWDIR%%_src-%%PORTVERSION%%/ChangeLog >>> >>> If I do so on my new 9.0 machine, it does not: >>> >>> %%WWWDIR%%_src-4.6.4/ChangeLog >>> >>> Why? What did I miss? >> >> >> genplist does not replace by default PORTVERSION (not defined in the >> genplist code) Maybe you have a custom script which looks like >> >> cat ~/.genplist/typo3 >> >> #!/bin/sh >> PV=$(make -V PORTVERSION) >> >> sed -i '' "|${PV}|%%PORTVERSION%%|g" $1 > > Ah, yes, I indeed patched genplist and added > > | sed "s|${portversion}|%%PORTVERSION%%|g" > > Thanks! > There is no need to patch genplist for such trivial changes ;) Just do a $> mkdir ~/.genplist touch ~/.genplist/$(make -V PORTNAME) Place the code snippet from my first mail into the new file make it executable. For more complex changes you can also use external perl/php ... scripts. The script will be called with the full path to pkg-plist.new ( code snippet form genplist: # Look for port-specific "plugin" scripts containing expressions like # "sed -i '' -E -e 's|^(foobar)|%%WITHFOOBAR%%\1|' ${1}". PL=$(realpath pkg-plist.new) if [ -f ~/.genplist/${portname} -a -x ~/.genplist/${portname} ]; then printf "\n $0: executing ~/.genplist/${portname} %s\n" ${PL} ~/.genplist/${portname} ${PL} fi )