Commit logs for 2014/04/11
Bryan Drewery
bdrewery at FreeBSD.org
Sat Apr 12 18:52:17 UTC 2014
On Apr 12, 2014, at 9:11, "Adam Weinberger" <adamw at adamw.org> wrote:
>> From: Bryan Drewery <bdrewery at FreeBSD.org>
>> Subject: svn commit: r351064 - in head: . Keywords Mk
>>
>> Author: bdrewery
>> Date: Sat Apr 12 03:39:02 2014
>> New Revision: 351064
>> URL: http://svnweb.freebsd.org/changeset/ports/351064
>> QAT: https://qat.redports.org/buildarchive/r351064/
>>
>> Log:
>> - Add a @sample plist keyword
>>
>> It accepts a file (must end in .sample, this is not configurable):
>>
>> @sample file.conf.sample
>>
>> This will install file.conf.sample and copy it to file.conf. The file.conf
>> will be removed if it matches file.conf.sample on deinstall.
>>
>> This replaces older patterns of:
>>
>> @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.sample; then rm -f %D/etc/pkgtools.conf; fi
>> etc/pkgtools.conf.sample
>> @exec [ -f %B/pkgtools.conf ] || cp %B/%f %B/pkgtools.conf
>>
>> [1] This somewhat obsoletes work in ports/157168 which added CONF_FILES,
>> but we have been moving towards more logic in pkg-plist where possible
>> and less magical macros. Though this thinking does clash with autoplist
>> ideas. We may still want CONF_FILES, which just drops a list of
>> @sample entries into the plist anyway.
>> - Add a Keywords/pkg_install.awk and hook it into generate-plist. This is
>> for pkg_install compatibility since it does not know how to read
>> Keywords/sample.yaml.
>> This file gives us a strategy to implement more keywords before
>> pkg_install is EOL.
>> Keywords are documented here:
>> https://github.com/freebsd/pkg/commit/bffc31420b1fd6146a43c9abcd45109dd901198a
>> - This needs to be documented in PH and portlint support added still.
>>
>> PR: ports/157168 [1]
>> Discussed with: bapt
>> Reviewed by: bapt
>> Requested by: many
>> With hat: portmgr
>
> First of all, thank you a thousand times for this. This, right here,
> this is the proof of the power of pkgNG.
>
> That said, I have a couple requests:
>
> * Please, please don't mandate .sample. Plenty of of ports install
> sample conf files with different extension. "-dist" is very common
> for php ports, for example. Let @sample take two arguments. Like
> @sample etc/pants.conf-dist pants.conf
> It is safe to assume that the target is in the same dir as the
> source.
I almost mentioned in the log, but pkg keywords don't accept more than 1 argument. So we are stuck with 1 for now.
We could potentially change pkg to work with arguments. At the same time having some consistency would be nice. .sample is very common. I almost did have support for -dist too, but discussing with Bapt we decided on consistency
More information about the svn-ports-all
mailing list