FELIX-2081: Attribtues and directives and not used on local resources

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@910622 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
index 5ae15df..4879ba8 100644
--- a/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
+++ b/bundlerepository/src/main/java/org/apache/felix/bundlerepository/LocalRepositoryImpl.java
@@ -409,6 +409,26 @@
                     cap.setName("package");
                     cap.addP(new PropertyImpl("package", null, pkgs[pkgIdx].getName()));
                     cap.addP(new PropertyImpl("version", "version", pkgs[pkgIdx].getVersion().toString()));
+                    for (int i = 0; i < pkgs[pkgIdx].getAttributes().length; i++)
+                    {
+                        R4Attribute attribute = pkgs[pkgIdx].getAttributes()[i];
+                        String key = attribute.getName();
+                        if (key.equalsIgnoreCase("specification-version")
+                                || key.equalsIgnoreCase("version"))
+                            continue;
+                        else
+                        {
+                            Object value = attribute.getValue();
+                            cap.addP(key, value);
+                        }
+                    }
+                    for (int i = 0; i < pkgs[pkgIdx].getDirectives().length; i++)
+                    {
+                        R4Directive directive = pkgs[pkgIdx].getDirectives()[i];
+                        String key = directive.getName();
+                        Object value = directive.getValue();
+                        cap.addP(key, value);
+                    }
                     addCapability(cap);
                 }
             }