Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Apr 2014 13:52:12 -0500
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        Adam Weinberger <adamw@adamw.org>
Cc:        "svn-ports-head@freebsd.org" <svn-ports-head@freebsd.org>, "svn-ports-all@freebsd.org" <svn-ports-all@freebsd.org>, "ports-committers@freebsd.org" <ports-committers@freebsd.org>
Subject:   Re: Commit logs for 2014/04/11
Message-ID:  <F6AD9096-EB8A-4C4D-980E-B3015B39C1E4@FreeBSD.org>
In-Reply-To: <EA3162FC-904F-4209-81D8-67CDADA357A2@adamw.org>
References:  <20140412035900.3C695121E45@apnoea.adamw.org> <EA3162FC-904F-4209-81D8-67CDADA357A2@adamw.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Apr 12, 2014, at 9:11, "Adam Weinberger" <adamw@adamw.org> wrote:

>> From: Bryan Drewery <bdrewery@FreeBSD.org>
>> Subject: svn commit: r351064 - in head: . Keywords Mk
>>=20
>> 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/
>>=20
>> Log:
>> - Add a @sample plist keyword
>>=20
>> It accepts a file (must end in .sample, this is not configurable):
>>=20
>>   @sample file.conf.sample
>>=20
>> This will install file.conf.sample and copy it to file.conf. The file.con=
f
>> will be removed if it matches file.conf.sample on deinstall.
>>=20
>> This replaces older patterns of:
>>=20
>>   @unexec if cmp -s %D/etc/pkgtools.conf %D/etc/pkgtools.conf.sample; the=
n rm -f %D/etc/pkgtools.conf; fi
>>   etc/pkgtools.conf.sample
>>   @exec [ -f %B/pkgtools.conf ] || cp %B/%f %B/pkgtools.conf
>>=20
>> [1] This somewhat obsoletes work in ports/157168 which added CONF_FILES,
>>     but we have been moving towards more logic in pkg-plist where possibl=
e
>>     and less magical macros. Though this thinking does clash with autopli=
st
>>     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/bffc31420b1fd6146a43c9abcd45109dd90=
1198a
>> - This needs to be documented in PH and portlint support added still.
>>=20
>> PR:        ports/157168 [1]
>> Discussed with:    bapt
>> Reviewed by:    bapt
>> Requested by:    many
>> With hat:    portmgr
>=20
> First of all, thank you a thousand times for this. This, right here,
> this is the proof of the power of pkgNG.
>=20
> That said, I have a couple requests:
>=20
> * 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 arg=
ument. So we are stuck with 1 for now.

We could potentially change pkg to work with arguments. At the same time hav=
ing some consistency would be nice.  .sample is very common. I almost did ha=
ve support for -dist too, but discussing with Bapt we decided on consistency=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?F6AD9096-EB8A-4C4D-980E-B3015B39C1E4>