Improve overriding A2 modules
[lgpl/argeo-commons.git] / org.argeo.init / src / org / argeo / init / a2 / ProvisioningManager.java
index 92df47ea8f744e6d587a21c7baf91db2ea067377..289870abc3ef945b7a2bb5f9b122027beb1af6cd 100644 (file)
@@ -158,8 +158,10 @@ public class ProvisioningManager {
                        } else {
                                A2Module lastOsgiModule = osgiBranch.last();
                                int compare = moduleVersion.compareTo(lastOsgiModule.getVersion());
-                               if (compare > 0) {// update
+                               if (compare >= 0) {// update (also if same version)
                                        Bundle bundle = (Bundle) lastOsgiModule.getLocator();
+                                       if (bundle.getBundleId() == 0)// ignore framework bundle
+                                               return null;
                                        moduleSource.update(bundle, module);
                                        // TODO make it more dynamic, based on OSGi APIs
                                        // TODO remove old module? Or keep update history?