#include <hallo.h> * Goswin von Brederlow [Sun, Mar 12 2006, 03:35:42PM]:
> I think it would be a good idea to have a general dpkg hook to > register a command to be run at the end of dpkg. The syntax would be > something like this: > > dpkg-hook /usr/lib/man/update-manpages - run only once in total > dpkg-hook --on-depends foobar ldconfig - run once before depends of foobar What is a depends? Do you mean dependency or dependents? Further, I would not depend on package installation operations but instead invent something like "dpkg-hook --execute ldconfig" to run outstanding tasks noted under the name "ldconfig". > dpkg-hook --add-option add-font -- path - add argument 'path' to a > previous add-font hook > dpkg-hook --no-wait foobar - run foobar in the background > > When dpkg is invoked it woul run those hook between depends of > packages or before terminating. When apt is run it could pass an > option to dpkg (except on the last run) to not run the hooks on exit > and they would be gathered for the full apt run. > > > Your option has the benefit of working NOW while mine would be more > general and work for manpages, fonts, menus, .... But one could > combine the two, make /usr/lib/dpkg/ldconfig into a script that calls > 'dpkg-hook --on-depends foobar /sbin/ldconfig'. The --on-depends might > not be needed as you said, one would have to try that. Still not fully undestanding what you mean with --on-depends... I guess we merge the both ideas to have something now. I have following vision: - a script called "dpkg-postponer" or so which may act different depending on argv[0] - a directory like /usr/lib/ccache with symlinks to dpkg-postponer, say /usr/lib/dpkg/hooks - a bunch of links to dpkg-postponer in that directory - dpkg-diverts on dpkg executable to have a link to dpkg-postponer and original dpkg So, when postponer is executed as "dpkg", it forks a daemon creating a Unix Domain socket and then runs original dpkg (note: this functionality can be moved to dpkg itself later). Before doing that it also prepends our symlink directory to $PATH. When executed as "dpkg-hook", it will do things you describe above - send the command and options trough the socket to the daemon, which calls the command on dpkg's exit. When executed as eg. "ldconfig" it will act like "dpkg-hook ldconfig". When dpkg terminates, the wrapper sends the daemon the "--execute" command and a "--terminate" command, then exits with dpkg's return code. That's all. IMO a matter of few hours to implement and test (in Perl). Eduard. -- Auf ähnlichem Niveau bewegen sich die Gehältern von Webdesignern, die ebenfalls zu den Verlierern unter den *Informatikern* zählen. -- Unispiegel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]