GNOME Bugzilla – Bug 306924
--makefile-uninstall-rule is incompatible with packaging systems
Last modified: 2010-12-13 03:46:22 UTC
There is a problem of incompatible design of current packaging systems (at least RPM and portage, probably deb, too) and GConf uninstall rules. GConf expects "remove old, then install new", packaging systems do "install new, then remove residues of old". It is not possible to uninstall rules correctly in all possible situations (schemas file deleted, schemas file moved to another package, schemas file splitted, keys was deleted key was moved to another schemas file) without permanently raising list of needed changes. Generally it causes only raising number of orphan GConf entries, but in particular situations (changes in thumbnailers) it can cause bad function of GNOME. There are two possible solutions - adopt packaging systems to be able to work with current packaging systems (for RPM it means implementation of %preuntrans scriptlet) or adopt GConf to be able to use current scriptlets %post and %preun. Third solution is creating alternative key database, which is independent on RPM and GConf and updates keys properly. This is an ugly work-around. I spent a lot of time trying to fix. But it's seems to be impossible without maintaining outdated keylists forever. The problem is, that packaging systems first installs new files, then removes old ones. It means, that --makefile-uninstall-rule in %preun is called after old files are overwritten, but it is designed to be called before overwritting of old files. But for example RPM does not have such feature. Note that packaging system solution will have principial problem with keys outage during update. It means, that application started during update will not work an may even introduce bad defaults to user GConf database. What needs to be changed in GConf to be compatible with current packaging systems: - Add serial to schemas file name. The serial has to be changed whenever key list in schemas file changes. - Add serial attribute to schemas file (or add serial to owner attribute). - Improve --makefile-uninstall-rule to uninstall only keys owned by proper owner (or add --makefile-uninstall-unowned-rule). - Optionally add ownership check to --makefile-install-rule - it should issue warning, when overwriting key with different owner. It can be OK if package is renamed, splitted, but generally it can mean problems. - Optionally implement --flush resp. --lock/--unlock option, which will signal all running gconf daemons to forget and re-read all cached values from selected source resp. lock the database and delay user daemons until database is unlocked.
FWIW, I don't think Debian is affected, in short it boils down to: - call prerm of old package (gconf-schemas --unregister) - upgrade files - call postinst of new package (gconf-schemas --register) The gconf snipsets are in the debhelper package, named postinst-gconf, and prerm-gconf. (The details are in http://www.debian.org/doc/debian-policy/ch-maintainerscripts.html)
The text does not speak axactly about the order. If prerm is called before placing new files, then it is not affected. RPM calls %preun (equal to prerm) after placing new files and before deleting old files. Note that all packaging systems has to place new files before removing old ones, otherwise system will have a short outage, which is not acceptable.
Maybe this is all clearer on this diagram: http://women.alioth.debian.org/wiki/images/mst/upgrade.png
In this case Debian is not affected.
The short list of 3 gconf todo items we need someone to work on includes a fix for this, item 2 "Move schemas out of the data store" and item 3 "Have apps load the schemas directly and use the defaults found there as emergency fallbacks" http://www.gnome.org/projects/gconf/plans.html It would be great to see effort go into a structural fix like that instead of making things even more complicated.
Created attachment 82224 [details] /etc/rpm/macros.gconf2 Here is a solution, which uses cooperation of three scriptlets, temporarily moving files to upgrade to a location, which is out of scope of rpm. This solution will be used for openSUSE 10.3 and later until gconf design will change.
Just in case someone reading this wants to do the real fix, I should point out that the real fix is not very hard if approached pragmatically. It could potentially be done in maybe a week or two of work, maybe less. It's not going to get done unless someone works on it though...
Another fix would be improvement of RPM - adding %preuntrans would make installation straightforward using current gconf. Debian has no such problems. http://osdir.com/ml/linux.redhat.rpm.devel/2006-01/msg00050.html http://www.mail-archive.com/rpm-maint@lists.rpm.org/msg00048.html
any news for this report?
The new GSettings/dconf stuff in GNOME 3 fixes this.
OK, then I close with Obsolete.