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

Alexander Leidinger Alexander at Leidinger.net
Wed Mar 31 11:49:22 UTC 2010

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


Behold the unborn foetus and
	Weep salt tears crocodilian;
All life is sacred (save, of course,
	An enemy civilian).

http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137

More information about the freebsd-ports mailing list