ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hi...@apache.org
Subject svn commit: r1342471 - in /ant/ivy/core/trunk: ./ src/java/org/apache/ivy/osgi/p2/ src/java/org/apache/ivy/osgi/repo/
Date Thu, 24 May 2012 22:46:56 GMT
Author: hibou
Date: Thu May 24 22:46:56 2012
New Revision: 1342471

URL: http://svn.apache.org/viewvc?rev=1342471&view=rev
Log:
The Updatesite resolver was downloading Eclipse features instead of Eclipse bundle/plugin

Modified:
    ant/ivy/core/trunk/CHANGES.txt
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
    ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java

Modified: ant/ivy/core/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/CHANGES.txt?rev=1342471&r1=1342470&r2=1342471&view=diff
==============================================================================
--- ant/ivy/core/trunk/CHANGES.txt (original)
+++ ant/ivy/core/trunk/CHANGES.txt Thu May 24 22:46:56 2012
@@ -128,6 +128,7 @@ for detailed view of each issue, please 
 =====================================
 - FIX: NullPointerExeption in AbstractOSGiResolver (IVY-1343) (thanks to Thomas Kurpick)
 - FIX: Delivered ivy descriptor inconsistent with resolve report / retrieve and other post-resolve
actions (IVY-1300) (thanks to Ed Burcher)
+- FIX: The Updatesite resolver is downloading Eclipse features instead of Eclipse bundle/plugin
 
    2.3.0-rc1
 =====================================

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java?rev=1342471&r1=1342470&r2=1342471&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java Thu May 24 22:46:56
2012
@@ -163,7 +163,7 @@ public class P2ArtifactParser implements
                     P2Artifact a = ((ArtifactHandler) child).p2Artifact;
                     String url = (String) patternsByClassifier.get(a.getClassifier());
                     url = url.replaceAll("\\$\\{repoUrl\\}", repoUrl);
-                    p2Descriptor.addArtifactUrl(a.getId(), a.getVersion(), url);
+                    p2Descriptor.addArtifactUrl(a.getClassifier(), a.getId(), a.getVersion(),
url);
                 }
             });
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java?rev=1342471&r1=1342470&r2=1342471&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java Thu May 24 22:46:56
2012
@@ -71,7 +71,11 @@ public class P2Descriptor extends RepoDe
         }
     }
 
-    public void addArtifactUrl(String id, Version version, String url) {
+    public void addArtifactUrl(String classifier, String id, Version version, String url)
{
+        if (!classifier.equals("osgi.bundle")) {
+            // we only support OSGi bundle, no Eclipse feature or anything else
+            return;
+        }
         Map/* <Version, String> */byVersion = (Map) artifactUrlPatterns.get(id);
         if (byVersion == null) {
             byVersion = new HashMap();

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java?rev=1342471&r1=1342470&r2=1342471&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java Thu May 24 22:46:56
2012
@@ -37,6 +37,7 @@ import org.apache.ivy.osgi.p2.Properties
 import org.apache.ivy.osgi.util.DelegetingHandler;
 import org.apache.ivy.osgi.util.Version;
 import org.apache.ivy.osgi.util.VersionRange;
+import org.apache.ivy.util.Message;
 import org.apache.ivy.util.XMLHelper;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
@@ -359,6 +360,8 @@ public class P2MetadataParser implements
                     Version version = ((ProvidedHandler) child).version;
                     String type = namespace2Type(((ProvidedHandler) child).namespace);
                     if (type == null) {
+                        Message.debug("Unsupported provided capability "
+                                + ((ProvidedHandler) child).namespace + " " + name + " "
+ version);
                         return;
                     }
                     BundleCapability capability;
@@ -425,7 +428,12 @@ public class P2MetadataParser implements
                     String name = ((RequiredHandler) child).name;
                     VersionRange range = ((RequiredHandler) child).range;
                     String type = namespace2Type(((RequiredHandler) child).namespace);
-                    requirements.add(new BundleRequirement(type, name, range, null));
+                    if (type == null) {
+                        Message.debug("Unsupported required capability "
+                                + ((RequiredHandler) child).namespace + " " + name + " "
+ range);
+                    } else {
+                        requirements.add(new BundleRequirement(type, name, range, null));
+                    }
                 }
             });
         }

Modified: ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
URL: http://svn.apache.org/viewvc/ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java?rev=1342471&r1=1342470&r2=1342471&view=diff
==============================================================================
--- ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java (original)
+++ ant/ivy/core/trunk/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java Thu May
24 22:46:56 2012
@@ -181,7 +181,7 @@ public abstract class AbstractOSGiResolv
         while (itMd.hasNext()) {
             ModuleDescriptor md = (ModuleDescriptor) itMd.next();
             IvyNode node = data.getNode(md.getModuleRevisionId());
-            if (node != null) {
+            if (node != null && node.getDescriptor() != null) {
                 // already resolved import, no need to go further
                 return new ResolvedResource[] {buildResolvedCapabilityMd(dd, node.getDescriptor())};
             }



Mime
View raw message