Am Freitag, den 11.09.2009, 11:18 +0200 schrieb Marc - A. Dahlhaus [ Administration | Westermann GmbH ]:
Hello List,
currently i'm working on adding a trigger infrastructure to libaplm/pacman to get rid of workload during upgrades or installations that runs more than a single time.
Good examples for such jobs would be:
- depmod after module installations - mkinitramfs after module installations - catalog-updates for fonts or infopages etc...
My current plan is to create a helper script called "alpmtrigger" wich handles the work of setting the triggers and executing the triggers after pacman is done with installation.
How would it work? Draft:
A package that adds a trigger to the system installs a trigger script that do all the work needed into a "/usr/share/pacman/alpmtrigger" dir.
inside of a packages install-helper we would call "alpmtrigger pkgtrigger" to set the trigger "pkgtrigger" active. alpmtrigger would do "touch /var/somewhere/alpmtrigger/pkgtrigger" wich would create the file if it not exists already.
A hook to execute "alpmtrigger" (without params?) would need to be added after the _alpm_run_chroot(root, "/sbin/ldconfig"); call in function _alpm_ldconfig inside of lib/libalpm/util.c to actualy scan the contents of /var/somewhere/alpmtrigger, and for each filename in it check if /usr/share/pacman/alpmtrigger/filename exists and if it is and is executable run the trigger. After the trigger is done and retuned without error, the file /var/somewhere/alpmtrigger/filename gets removed.
Any suggestions, comments or somebody else working on such a thing?
I took some time to rethink my first plan... It would be more useful it the implementation of alpmtrigger gains the ability to also execute a trigger currently. alpmtrigger trigger Run the trigger now. alpmtrigger {-a|--add} trigger Add the trigger to queue alpmtrigger {-r|--remove} trigger Remove the trigger from queue alpmtrigger [-x|--execute] Run all queued triggers This way we would gain all the abilities required to trigger any task we want at any point we want (by just adding the right thing to the right spot in packages install helpers). Marc