You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@karaf.apache.org by ff...@apache.org on 2015/03/03 08:10:33 UTC

karaf git commit: [KARAF-3579]bundles in etc/startup.properties shouldn't be uninstalled through feature service

Repository: karaf
Updated Branches:
  refs/heads/karaf-2.x 442537881 -> ae748e051


[KARAF-3579]bundles in etc/startup.properties shouldn't be uninstalled through feature service


Project: http://git-wip-us.apache.org/repos/asf/karaf/repo
Commit: http://git-wip-us.apache.org/repos/asf/karaf/commit/ae748e05
Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/ae748e05
Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/ae748e05

Branch: refs/heads/karaf-2.x
Commit: ae748e051b16e8b7398d0afb934ab75dcbb9f7d2
Parents: 4425378
Author: Freeman Fang <fr...@gmail.com>
Authored: Tue Mar 3 15:06:20 2015 +0800
Committer: Freeman Fang <fr...@gmail.com>
Committed: Tue Mar 3 15:06:20 2015 +0800

----------------------------------------------------------------------
 .../karaf/features/internal/FeaturesServiceImpl.java     | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/ae748e05/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
----------------------------------------------------------------------
diff --git a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
index 406691e..b937851 100644
--- a/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
+++ b/features/core/src/main/java/org/apache/karaf/features/internal/FeaturesServiceImpl.java
@@ -722,9 +722,14 @@ public class FeaturesServiceImpl implements FeaturesService {
         List<InstallResult> installResultList = new LinkedList<InstallResult>();
         for (BundleInfo bInfo : resolve(feature)) {
             InstallResult result = installBundleIfNeeded(state, bInfo, verbose);
-            bundles.add(result.getBundle().getBundleId());
-            state.bundleInfos.put(result.getBundle().getBundleId(), bInfo);
-            installResultList.add(result);
+            if (!result.isPreviouslyInstalled()) {
+                //only associate the bundles installed by this feature
+                //so that when uninstall this feature, won't uninstall bundles
+                //installed by other features or from the startup.properties
+                bundles.add(result.getBundle().getBundleId());
+                state.bundleInfos.put(result.getBundle().getBundleId(), bInfo);
+                installResultList.add(result);
+            }
         }
         for (InstallResult result : installResultList) {
             if (!result.isPreviouslyInstalled()) {