On 16 November 2012 14:34, Michael Schroeder email@example.com wrote:
On Fri, Nov 16, 2012 at 02:26:54PM +0000, Cristian Morales Vega wrote:
On 11 September 2012 16:59, Michael Schroeder firstname.lastname@example.org wrote:
Dunno, I haven't looked at the details. If it can't be done, I'll try to push my virtual triggers upstream ;)
What's the status?
Too much other work right now. Maybe someone else has time to experiment with the "collection" feature?
OK. The collections stuff is like this:
- You add a "Collections: XXXXX" line to the preamble - rpmbuild stores XXXXX in the RPM. - When installed, rpm runs whatever %__collection_XXXXX (from /usr/lib/rpm/macros) is defined to in the user's machine.
The %__collection_XXXXX thing run a "plugin". Right now there are only two -- exec.so and sepolicy.so --, installed in /usr/lib64/rpm-plugins/. exec.so is a generic one that will run whatever is the parameter.
The plugin interface has six functions:
rpmRC PLUGINHOOK_INIT_FUNC(rpmts ts, const char * name, const char * opts); rpmRC PLUGINHOOK_CLEANUP_FUNC(void); rpmRC PLUGINHOOK_OPENTE_FUNC(rpmte te); rpmRC PLUGINHOOK_COLL_POST_ANY_FUNC(void); rpmRC PLUGINHOOK_COLL_POST_ADD_FUNC(void); rpmRC PLUGINHOOK_COLL_PRE_REMOVE_FUNC(void);
The exec.so plugin only runs in PLUGINHOOK_COLL_POST_ANY_FUNC; Having access to rpmte I guess you can do all kind of funny things. But in general we should have enough with exec.so.
Conclusion: until the libzypp guys start to run more than a single RPM in each transaction we are not winning a lot here. There is not a big difference between adding a "%reconfigure_fonts_scriptlets" line to your .spec file as we do now, or a "Collections: font" line. But once the libzypp guys start using bigger transaction this will make them faster.
In any case this doesn't solve the "we want to add a new scriptlet and it takes 5 years for all packages to be adapted" problem (gtk-update-icon-cache for all the packages with icons). We need one of:
- Mandrivas's file triggers patch - Virtual triggers - find-collections so all packages with files under /usr/share/fonts/ would be automatically added to the "font" collections (and change %__collection_font to use fonts-config instead of fc-cache directly ;-) )
Possible for 12.3 + 1?