karaf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbono...@apache.org
Subject karaf git commit: [KARAF-5197] Kar service now checks features install flag
Date Mon, 12 Jun 2017 13:20:06 GMT
Repository: karaf
Updated Branches:
  refs/heads/karaf-4.0.x 9781269d4 -> 97d560209


[KARAF-5197] Kar service now checks features install flag


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

Branch: refs/heads/karaf-4.0.x
Commit: 97d560209471af8d57f6399ea47d8fcddc58f881
Parents: 9781269
Author: Jean-Baptiste Onofré <jbonofre@apache.org>
Authored: Mon Jun 12 15:18:11 2017 +0200
Committer: Jean-Baptiste Onofré <jbonofre@apache.org>
Committed: Mon Jun 12 15:19:53 2017 +0200

----------------------------------------------------------------------
 .../karaf/kar/internal/KarServiceImpl.java      | 30 ++++++++++++--------
 1 file changed, 18 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/karaf/blob/97d56020/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
----------------------------------------------------------------------
diff --git a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
index f769fc8..ff071e9 100644
--- a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
+++ b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java
@@ -275,15 +275,19 @@ public class KarServiceImpl implements KarService {
                 if (repository.getURI().equals(karFeatureRepoUri)) {
                     try {
                         for (Feature feature : repository.getFeatures()) {
-                            try {
-                                LOGGER.debug("noAutoRefreshBundles is " + isNoAutoRefreshBundles());
-                                if (isNoAutoRefreshBundles()) {
-                                    featuresService.installFeature(feature, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles));
-                                } else {
-                                    featuresService.installFeature(feature, EnumSet.noneOf(FeaturesService.Option.class));
+                            if (feature.getInstall() == null || !feature.getInstall().equals("manual"))
{
+                                try {
+                                    LOGGER.debug("noAutoRefreshBundles is " + isNoAutoRefreshBundles());
+                                    if (isNoAutoRefreshBundles()) {
+                                        featuresService.installFeature(feature, EnumSet.of(FeaturesService.Option.NoAutoRefreshBundles));
+                                    } else {
+                                        featuresService.installFeature(feature, EnumSet.noneOf(FeaturesService.Option.class));
+                                    }
+                                } catch (Exception e) {
+                                    LOGGER.warn("Unable to install Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
                                 }
-                            } catch (Exception e) {
-                                LOGGER.warn("Unable to install Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
+                            } else {
+                                LOGGER.warn("Feature " + feature.getName() + "/" + feature.getVersion()
+ " has install flag set to \"manual\", so it's not automatically installed");
                             }
                         }
                     } catch (Exception e) {
@@ -427,10 +431,12 @@ public class KarServiceImpl implements KarService {
                 if (repository.getURI().equals(karFeatureRepoUri)) {
                     try {
                         for (Feature feature : repository.getFeatures()) {
-                            try {
-                                featuresService.uninstallFeature(feature.getName(), feature.getVersion());
-                            } catch (Exception e) {
-                                LOGGER.warn("Unable to uninstall Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
+                            if (feature.getInstall() == null || !feature.getInstall().equals("manual"))
{
+                                try {
+                                    featuresService.uninstallFeature(feature.getName(), feature.getVersion());
+                                } catch (Exception e) {
+                                    LOGGER.warn("Unable to uninstall Kar feature {}", feature.getName()
+ "/" + feature.getVersion(), e);
+                                }
                             }
                         }
                     } catch (Exception e) {


Mime
View raw message