[pacman-dev] [RFC] alpmtrigger: triggering events after all packages got installed...

Xavier shiningxc at gmail.com
Sat Sep 12 16:53:13 EDT 2009


On Sat, Sep 12, 2009 at 10:29 PM, Marc - A. Dahlhaus <mad at wol.de> wrote:
>
> Please take a closer look at the proposed events and what it means in an
> implementation to get them going on large transaction like a full system
> installation (copied from the wiki):
>
>    * Install - run on installation of a matching file/package
>    * PostInstall - run after installation of a matching file/package
>    * PreRemove - run prior to removal of a matching file/package
>    * PostRemove - run after to removal of a matching file/package
>    * Transaction - run at end of transaction involving at least one matching
> file
>
> I think that to get there for all of them, you have to constantly rescan the
> hook.d directory during the whole transaction to load the freshly added
> configurations and hooks and also have to rescan the whole list of already
> installed or removed files in the running transaction for every freshly
> added hook to solve the chicken-egg problems and installation of new hooks
> during transaction.
>

You are right, I was thinking about these problems.
I guess I would just ignore the chicken-eggs problem (we already have
to deal with this anyway with the current scriptlets, and it seems to
work good enough ...), and also limit the features and functionality
to make the implementation more doable :)

We do not have to rescan the whole hooks.d directory, we could simply
monitor files added there, and just reload this file. And this new
hook would only be applied for the following packages.

>
> As i couldn't convince you even a little bit at all that triggers would be a
> nice thing to have in pacman so far instead of having a draft for something
> that nobody wants to implement at the moment, i'll go ahead and implement it
> tomorrow as i want to use such a functionality better sooner than later...
>
> If anybody is interested in it and wants to test it, drop me a line...
>

this thread is getting huge, I think one of my mail got lost in the
deep, when I was thinking about alternatives to implement your trigger
idea :

Otherwise, it seems that Marc is saying that install scriptlets are
fine, and he wants to add two functionality :
1) transaction level hook
2) sharing code

1 could be even more easily achieved by just defining a new function
in scriptlets, eg transaction()
2 could be achieved with function libraries (see
http://bugs.archlinux.org/task/10375)

Again here, it is not clear to me which method is better, I am just
throwing out ideas.


More information about the pacman-dev mailing list