[RFC] deprecate @exec and @unexec in plists in favor of pre-install and post-install scripts

Florent Thoumie flz at xbsd.org
Wed Mar 31 12:01:15 UTC 2010

On Wed, Mar 31, 2010 at 11:49 AM, Alexander Leidinger
<Alexander at leidinger.net> wrote:
> Quoting Florent Thoumie <flz at xbsd.org> (from Mon, 29 Mar 2010 09:10:54
> +0000):
>> I mentioned getting rid of those pesky @*exec lines a few years ago,
>> but this was met by quite a lot of objection.
>> I still think it would be a good change, assuming that we provide
>> equivalent (or better) features:
>> - Configuration files should be marked and automatically dealt with by
>> the infrastructure, not by esoteric commands.
>> - Subroutines for shell scripts should be provided along with
>> pkg_install, or be installed by a third party port (users/groups
>> creation comes to mind).
>> - Scripts should be automatically picked up as you mentioned. We're
>> trying to shove most targets in pkg-install, but it probably would be
>> best to split it (preinstall, postinstall, predeinstall,
>> postdeinstall). Good thing is, this doesn't require any change in
>> pkg_install since it's already supported.
>> One of the added bonus is that some code that appears both in Makefile
>> and pkg-plist will only be in preinstall/postinstall scripts.
> Given that a lot of the @(un)exec is comming from ports/Mk/bsd.*.mk, and
> that you can detect if there is already a pre-/post-install script in
> bsd.port.mk, it should be not so hard for the people which propose those
> (IMO good) ideas to come up with a patch for bsd.port.mk which generates
> pre-/post-install scripts with appropriate commands and does not add the
> @(un)exec to pkg-plist for those ports, which do not have a
> pre-/post-install script.

That would be a good start indeed, but this is the easy part.

> It could serve as a proof of concept and would
> show more clearly what you have in mind. Done nicely, it also allows to keep
> a lot of the stuff in the Makefile and only write such scripts by hand if
> absolutely necessary (think about e.g. "CREATE_USER=name1:UID1 name2:UID2"
> which would already cover a lot if not most use cases).

CREATE_USER? Have you been living under a rock recently? :-)

I suppose Garrett sent this email to get a feel of what the general
consensus was. If it turns out that people agree we should get rid of
those lines, then I'm sure we can find people willing to do the
necessary work.

Florent Thoumie
flz at FreeBSD.org
FreeBSD Committer

More information about the freebsd-ports mailing list