[Qgis-developer] Moving core plugins into core and implementingproperty lists

Borys Jurgiel borysiasty at aster.pl
Sun Nov 15 10:40:29 EST 2009


Dnia niedziela, 15 listopada 2009 o 14:46:35 Richard Duivenvoorde napisał(a):
> Oops sorry for bringing it into this discussion then :-(
> I was thinking in line of the 'core python plugins' like mapserver
> export etc...

So yes :) They are upgradeable. All you need is just to upload the plugin to 
any repository you want.

But you must be aware how it works, to avoid mistakes with versioning etc.

The core plugins install in a system directory like that:
/usr/share/qgis/python/plugins 

while all repositroty plugins (including the upgrades we're talking about) in 
an user directory like:
/home/richard/.qgis/python/plugins

So if an user upgrades a core plugin, he gets in fact two instances of it: the 
'original' one, shipped with qgis and the updated one. It's because of 
permissions. The 'userspace' plugins always mask their core instances.  And 
this is _critically_important_ to always set a proper version number for both 
instances.

Let's assume, users have Qgis with MapserverExport  v 1.0. Then you upgrade it 
in Trunk to 1.1, and at the same time, upload this version into py plugins 
repository. The Installer finds it and performs upgrade by installing the 1.1 
in the 'userspace' location. It masks the original 1.0 and everything works 
ok. Great. Also after qgis recompilation, when the 'system' instance is 
upgraded, still everything is ok, as just the 1.1 masks another 1.1.

But then let's assume that you upgrade the plugin in trunk to 1.2 and forget 
to upload it into the repository. After qgis recompilation & reinstalation, 
the /usr directory contains 1.2 version and the /home/richard contains still 
the 1.1 (and there's no possibility to upgrade). Qgis detects such situation 
when loading, displays a complaining message and suggests to run the Installer 
to resolve this situation.

So, the most important are to:
- never increase the plugin version  in trunk unless you upload it also to the 
plugin repo
- always ensure there's the same version number in trunk and the plugin repo, 
in both __init__.py and repository .xml file 

Don't hesitate to ask if there's something unclear and share your ideas if you 
find this behaviour ugly :)

B.


More information about the Qgis-developer mailing list