Commit logs for 2014/04/11

Adam Weinberger adamw at adamw.org
Sat Apr 12 14:11:48 UTC 2014


> 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.

* Please document pkg stuff in the Porter's Handbook. There is no
   mention of the keywords in there (and the commit you referenced
   only documents the EXISTENCE of keywords, not enumerate them or
   show how to use them). Also there needs to be an explanation of
   the different aliases in pkg-create(1), %D and %P and such,
   because they're very confusing.

# Adam


--
Adam Weinberger
adamw at adamw.org
http://www.adamw.org


More information about the svn-ports-head mailing list