You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2018/04/17 19:37:05 UTC

[sling-whiteboard] 02/02: Fix system bundle fragments handling

This is an automated email from the ASF dual-hosted git repository.

rombert pushed a commit to branch misc-fixes
in repository https://gitbox.apache.org/repos/asf/sling-whiteboard.git

commit ff02acbffb77953b688b6c01e45507f0b6ae9953
Author: Robert Munteanu <ro...@apache.org>
AuthorDate: Tue Apr 17 22:36:01 2018 +0300

    Fix system bundle fragments handling
---
 .../java/org/apache/sling/feature/resolver/FrameworkResolver.java    | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/featuremodel/feature-resolver/src/main/java/org/apache/sling/feature/resolver/FrameworkResolver.java b/featuremodel/feature-resolver/src/main/java/org/apache/sling/feature/resolver/FrameworkResolver.java
index bd93d72..f0bf929 100644
--- a/featuremodel/feature-resolver/src/main/java/org/apache/sling/feature/resolver/FrameworkResolver.java
+++ b/featuremodel/feature-resolver/src/main/java/org/apache/sling/feature/resolver/FrameworkResolver.java
@@ -98,6 +98,7 @@ public class FrameworkResolver implements FeatureResolver {
             BundleRevision br = framework.adapt(BundleRevision.class);
             capabilities.put(PackageNamespace.PACKAGE_NAMESPACE, br.getCapabilities(PackageNamespace.PACKAGE_NAMESPACE));
             capabilities.put(BundleNamespace.BUNDLE_NAMESPACE, br.getCapabilities(BundleNamespace.BUNDLE_NAMESPACE));
+            capabilities.put(HostNamespace.HOST_NAMESPACE, br.getCapabilities(HostNamespace.HOST_NAMESPACE));
             capabilities.put(IdentityNamespace.IDENTITY_NAMESPACE, br.getCapabilities(IdentityNamespace.IDENTITY_NAMESPACE));
             frameworkResource = new BundleResourceImpl(framework.getSymbolicName(), framework.getVersion(), null, null,
                     capabilities, Collections.emptyMap());
@@ -231,6 +232,10 @@ public class FrameworkResolver implements FeatureResolver {
                 // This is a fragment
                 Requirement req = reqs.iterator().next(); // TODO handle more host requirements
                 String bsn = req.getAttributes().get(HostNamespace.HOST_NAMESPACE).toString(); // TODO this is not valid, should obtain from filter
+                // system bundle is already started, no need to reorder here
+                if ( Constants.SYSTEM_BUNDLE_SYMBOLICNAME.equals(bsn)) {
+                    continue;
+                }
                 int idx = getBundleIndex(orderedResources, bsn); // TODO check for filter too
                 if (idx < i) {
                     // the fragment is after the host, and should be moved to be before the host

-- 
To stop receiving notification emails like this one, please contact
rombert@apache.org.