Subject: Re: Virtual packages and package classes
To: None <tech-pkg@netbsd.org>
From: None <joerg@britannica.bec.de>
List: tech-pkg
Date: 06/27/2006 13:08:53
On Tue, Jun 27, 2006 at 01:40:53AM +0200, Roland Illig wrote:
> I suggest an alternative form:
> 
>     lib/X11/fonts/X11/geni102.ttf
>     @post-install register-truetype-font %f
>     @pre-deinstall unregister-truetype-font %f
>     lib/X11/fonts/X11/geni102.ttf
>     @post-install register-truetype-font %f
>     @pre-deinstall unregister-truetype-font %f
> 
> This way it is clear which arguments the trigger gets (they will be 
> parsed like in the shell, and %f expands to the properly quoted filename 
> that occured last). You can also define triggers that don't take any 
> arguments with this scheme.

(a) What happens if a package "forgets" the pre-deinstall line? I
explicitly want to avoid that since it is an implementation detail of
the trigger whether or not it is actually a real function.

(b) Non-file related stuff doesn't belong into the PLIST. Let's not
reintroduce @exec please, it should be considered a zombie.

> Every package can install its own triggers, for example in 
> libexec/pkg_triggers/. There could also be a trigger called "exec" that 
> executes its arguments via the exec() functions.

I don't have a big opinion how the actual trigger scripts are hooked up,
e.g. by putting them in libexec/pkg_trigger/%trigger%/%pkgname%. No
exec.

> pkg_add should get a --paranoid or --interactive mode, which will ask 
> the pkgsrc user before running each trigger. To reduce the burden, some 
> triggers may be defined as trusted by the pkgsrc user in a special 
> configuration file.

Yes, that was the intention.

Joerg