After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 306924 - --makefile-uninstall-rule is incompatible with packaging systems
--makefile-uninstall-rule is incompatible with packaging systems
Status: RESOLVED OBSOLETE
Product: GConf
Classification: Deprecated
Component: gconf
2.10.x
Other Linux
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks:
 
 
Reported: 2005-06-08 17:05 UTC by Stanislav Brabec
Modified: 2010-12-13 03:46 UTC
See Also:
GNOME target: ---
GNOME version: 2.9/2.10


Attachments
/etc/rpm/macros.gconf2 (2.68 KB, text/plain)
2007-02-09 15:14 UTC, Stanislav Brabec
Details

Description Stanislav Brabec 2005-06-08 17:05:48 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.
Comment 1 Loïc Minier 2006-01-10 12:54:27 UTC
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)
Comment 2 Stanislav Brabec 2006-01-10 14:43:13 UTC
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.
Comment 3 Loïc Minier 2006-01-10 15:07:18 UTC
Maybe this is all clearer on this diagram:
http://women.alioth.debian.org/wiki/images/mst/upgrade.png
Comment 4 Stanislav Brabec 2006-01-10 15:49:45 UTC
In this case Debian is not affected.
Comment 5 Havoc Pennington 2006-11-24 18:18:00 UTC
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.
Comment 6 Stanislav Brabec 2007-02-09 15:14:30 UTC
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.
Comment 7 Havoc Pennington 2007-02-09 15:51:54 UTC
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...
Comment 8 Stanislav Brabec 2007-10-02 16:36:31 UTC
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
Comment 9 Fabio Durán Verdugo 2010-12-13 03:24:04 UTC
any news for this report?
Comment 10 Havoc Pennington 2010-12-13 03:34:34 UTC
The new GSettings/dconf stuff in GNOME 3 fixes this.
Comment 11 Fabio Durán Verdugo 2010-12-13 03:46:22 UTC
OK, then I close with Obsolete.