Author: hibou
Date: Thu May 24 22:48:04 2012
New Revision: 1342472
URL: http://svn.apache.org/viewvc?rev=1342472&view=rev
Log:
merge of r1342471:
The Updatesite resolver is downloading Eclipse features instead of Eclipse
bundle/plugin
Modified:
ant/ivy/core/branches/2.3.x/ (props changed)
ant/ivy/core/branches/2.3.x/CHANGES.txt
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
Propchange: ant/ivy/core/branches/2.3.x/
------------------------------------------------------------------------------
Merged /ant/ivy/core/trunk:r1342471
Modified: ant/ivy/core/branches/2.3.x/CHANGES.txt
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/CHANGES.txt?rev=1342472&r1=1342471&r2=1342472&view=diff
==============================================================================
--- ant/ivy/core/branches/2.3.x/CHANGES.txt (original)
+++ ant/ivy/core/branches/2.3.x/CHANGES.txt Thu May 24 22:48:04 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/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java?rev=1342472&r1=1342471&r2=1342472&view=diff
==============================================================================
---
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
(original)
+++
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2ArtifactParser.java
Thu May 24 22:48:04 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/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java?rev=1342472&r1=1342471&r2=1342472&view=diff
==============================================================================
---
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java
(original)
+++
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2Descriptor.java
Thu May 24 22:48:04 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/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java?rev=1342472&r1=1342471&r2=1342472&view=diff
==============================================================================
---
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
(original)
+++
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/p2/P2MetadataParser.java
Thu May 24 22:48:04 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/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
URL:
http://svn.apache.org/viewvc/ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java?rev=1342472&r1=1342471&r2=1342472&view=diff
==============================================================================
---
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
(original)
+++
ant/ivy/core/branches/2.3.x/src/java/org/apache/ivy/osgi/repo/AbstractOSGiResolver.java
Thu May 24 22:48:04 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())};
}