Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 7AE16200C92 for ; Mon, 12 Jun 2017 15:19:41 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 79686160BD9; Mon, 12 Jun 2017 13:19:41 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BF000160BD6 for ; Mon, 12 Jun 2017 15:19:40 +0200 (CEST) Received: (qmail 39281 invoked by uid 500); 12 Jun 2017 13:19:40 -0000 Mailing-List: contact commits-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list commits@karaf.apache.org Received: (qmail 39272 invoked by uid 99); 12 Jun 2017 13:19:39 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 12 Jun 2017 13:19:39 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id C2539DFB8A; Mon, 12 Jun 2017 13:19:39 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: jbonofre@apache.org To: commits@karaf.apache.org Message-Id: <4bdd6a171ea54441a544b3566ff07482@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: karaf git commit: [KARAF-5197] Kar service now checks features install flag Date: Mon, 12 Jun 2017 13:19:39 +0000 (UTC) archived-at: Mon, 12 Jun 2017 13:19:41 -0000 Repository: karaf Updated Branches: refs/heads/karaf-4.1.x 7a842870c -> c1956822e [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/c1956822 Tree: http://git-wip-us.apache.org/repos/asf/karaf/tree/c1956822 Diff: http://git-wip-us.apache.org/repos/asf/karaf/diff/c1956822 Branch: refs/heads/karaf-4.1.x Commit: c1956822ef16fb0d6b4aa28c1736cc5d6d7fa9e6 Parents: 7a84287 Author: Jean-Baptiste Onofré Authored: Mon Jun 12 15:18:11 2017 +0200 Committer: Jean-Baptiste Onofré Committed: Mon Jun 12 15:19:22 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/c1956822/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) {