Date: Tue, 06 Mar 2012 22:06:15 +0100 From: Olli Hauer <ohauer@FreeBSD.org> To: freebsd-ports@freebsd.org Cc: Helmut Schneider <jumper99@gmx.de> Subject: Re: Problem with genplist replacing PORTVERSION Message-ID: <4F567C47.7080205@FreeBSD.org> In-Reply-To: <xn0hva8vl4fi2fl002@news.gmane.org> References: <xn0hva8d04er786001@news.gmane.org> <4F567784.9090801@FreeBSD.org> <xn0hva8vl4fi2fl002@news.gmane.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4F567C47.7080205>
