Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff McAffer2007-11-09 04:22:59 +0000
committerJeff McAffer2007-11-09 04:22:59 +0000
commitfcea91b2f7245eed48cd1567632b3abdeaef85c6 (patch)
treedb4d3df7796765a629a0ce3721b07a22b13919a6
parentfc90971ca172753f1bbb91cedb638771fdab18fd (diff)
downloadrt.equinox.p2-fcea91b2f7245eed48cd1567632b3abdeaef85c6.tar.gz
rt.equinox.p2-fcea91b2f7245eed48cd1567632b3abdeaef85c6.tar.xz
rt.equinox.p2-fcea91b2f7245eed48cd1567632b3abdeaef85c6.zip
update the JarDelta optimizer/processors, integrate with JBdiff and add some tests
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml10
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/Activator.java (renamed from bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Activator.java)5
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java20
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java56
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/JarDeltaOptimizerStep.java122
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java241
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/AbstractDeltaDiffStep.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Application.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java30
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java13
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF9
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/plugin.xml6
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/jardelta/JarDeltaStep.java36
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/Activator.java (renamed from bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/p2/artifact/processors/Activator.java)2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java157
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/JarDeltaProcessorStep.java116
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jbdiff/AbstractDeltaPatchStep.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Unpack200Step.java (renamed from bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/pack200/Unpack200Step.java)2
-rw-r--r--bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/verifier/MD5Verifier.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ArtifactKey.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF7
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/rawData/Test Data Generator.launch6
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.1.jarbin0 -> 1958 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.2.jarbin0 -> 1939 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/AllTests.java3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/JarDeltaRepositoryTest.java137
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/PackRepositoryTest.java50
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.jarbin47373 -> 51243 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.zipbin0 -> 50876 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/artifacts.xml76
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/content.xml451
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.1.jarbin0 -> 1958 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.2.jarbin0 -> 1939 bytes
40 files changed, 1207 insertions, 408 deletions
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
index d70ccdda9..132d2227f 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/META-INF/MANIFEST.MF
@@ -5,10 +5,11 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-Version: 0.1.0.qualifier
-Bundle-Activator: org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Activator
+Bundle-Activator: org.eclipse.equinox.internal.p2.artifact.optimizers.Activator
Import-Package: ie.wombat.jbdiff,
org.eclipse.equinox.app;version="1.0.0",
org.eclipse.equinox.internal.p2.core.helpers,
+ org.eclipse.equinox.internal.p2.metadata,
org.eclipse.equinox.p2.artifact.repository,
org.eclipse.equinox.p2.artifact.repository.processing,
org.eclipse.equinox.p2.core.repository,
@@ -21,6 +22,7 @@ Eclipse-LazyStart: true
Require-Bundle: org.eclipse.equinox.common
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
J2SE-1.4
-Export-Package: org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;x-internal:=true,
+Export-Package: org.eclipse.equinox.internal.p2.artifact.optimizers;x-internal:=true,
+ org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;x-internal:=true,
org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff;x-internal:=true,
org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;x-internal:=true
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml b/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml
index 7a9b859a2..d384752c7 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/plugin.xml
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.2"?>
<plugin>
- <extension id="jaroptimizer" point="org.eclipse.core.runtime.applications">
+ <extension id="jardeltaoptimizer" point="org.eclipse.core.runtime.applications">
<application>
<run class="org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta.Application"/>
</application>
@@ -13,16 +13,16 @@
</application>
</extension>
- <extension id="Pack200Packer" point="org.eclipse.equinox.p2.artifact.repository.processingSteps">
- <step class="org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Pack200Step"/>
- </extension>
-
<extension id="jbdiffoptimizer" point="org.eclipse.core.runtime.applications">
<application>
<run class="org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff.Application"/>
</application>
</extension>
+ <extension id="Pack200Packer" point="org.eclipse.equinox.p2.artifact.repository.processingSteps">
+ <step class="org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Pack200Step"/>
+ </extension>
+
<extension id="JBDiffStep" point="org.eclipse.equinox.p2.artifact.repository.processingSteps">
<step class="org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff.JBDiffStep"/>
</extension>
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/Activator.java
index c451de00a..cfcd1e8d9 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/Activator.java
@@ -7,14 +7,13 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
-package org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff;
+package org.eclipse.equinox.internal.p2.artifact.optimizers;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
-
- public static final String ID = "org.eclipse.equinox.p2.artifact.optimizer.jbdiff"; //$NON-NLS-1$
+ public static final String ID = "org.eclipse.equinox.p2.artifact.optimizers"; //$NON-NLS-1$
private static BundleContext context = null;
public static BundleContext getContext() {
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java
deleted file mode 100644
index e23c1354c..000000000
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Activator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
- public static final String ID = "org.eclipse.equinox.p2.artifact.optimizer.jardelta"; //$NON-NLS-1$
- private static BundleContext context = null;
-
- public static BundleContext getContext() {
- return context;
- }
-
- public void start(BundleContext context) throws Exception {
- Activator.context = context;
- }
-
- public void stop(BundleContext context) throws Exception {
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java
index 02944bf90..d16090f38 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Application.java
@@ -12,19 +12,25 @@ import java.net.URL;
import java.util.Map;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.Activator;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepositoryManager;
+/**
+ * The optimizer <code>Application</code> for JBDiff based optimizations.
+ */
public class Application implements IApplication {
private URL artifactRepositoryLocation;
+ private int width = 1;
+ private int depth = 1;
public Object start(IApplicationContext context) throws Exception {
Map args = context.getArguments();
- initializeFromArguments((String[]) args.get("application.args"));
+ initializeFromArguments((String[]) args.get("application.args")); //$NON-NLS-1$
IArtifactRepository repository = setupRepository(artifactRepositoryLocation);
- // TODO add the processing in here.
+ new Optimizer(repository, width, depth).run();
return null;
}
@@ -37,6 +43,7 @@ public class Application implements IApplication {
}
public void stop() {
+ // nothing to do yet
}
public void initializeFromArguments(String[] args) throws Exception {
@@ -54,8 +61,15 @@ public class Application implements IApplication {
continue;
String arg = args[++i];
- if (args[i - 1].equalsIgnoreCase("-artifactRepository") | args[i - 1].equalsIgnoreCase("-ar"))
+ if (args[i - 1].equalsIgnoreCase("-artifactRepository") || args[i - 1].equalsIgnoreCase("-ar")) //$NON-NLS-1$ //$NON-NLS-2$
artifactRepositoryLocation = new URL(arg);
+
+ if (args[i - 1].equalsIgnoreCase("-depth")) //$NON-NLS-1$
+ depth = Integer.parseInt(arg);
+
+ if (args[i - 1].equalsIgnoreCase("-width")) //$NON-NLS-1$
+ width = Integer.parseInt(arg);
+
}
}
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java
index bb101d077..a176e939a 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/DeltaComputer.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
import java.io.*;
@@ -34,18 +44,23 @@ public class DeltaComputer {
private void writeDelta() {
JarOutputStream result = null;
try {
- result = new JarOutputStream(new FileOutputStream(destination));
- // write out the removals. These are all the entries left in the baseEntries
- // since they were not seen in the targetJar. Here just write out an empty
- // entry with a name that signals the delta processor to delete.
- for (Iterator i = baseEntries.iterator(); i.hasNext();)
- writeEntry(result, new JarEntry(((JarEntry) i.next()).getName() + ".delete"), null);
- // write out the additions.
- for (Iterator i = additions.iterator(); i.hasNext();)
- writeEntry(result, (JarEntry) i.next(), targetJar);
- // write out the changes.
- for (Iterator i = changes.iterator(); i.hasNext();)
- writeEntry(result, (JarEntry) i.next(), targetJar);
+ try {
+ result = new JarOutputStream(new FileOutputStream(destination));
+ // write out the removals. These are all the entries left in the baseEntries
+ // since they were not seen in the targetJar. Here just write out an empty
+ // entry with a name that signals the delta processor to delete.
+ for (Iterator i = baseEntries.iterator(); i.hasNext();)
+ writeEntry(result, new JarEntry(((String) i.next()) + ".delete"), null);
+ // write out the additions.
+ for (Iterator i = additions.iterator(); i.hasNext();)
+ writeEntry(result, (JarEntry) i.next(), targetJar);
+ // write out the changes.
+ for (Iterator i = changes.iterator(); i.hasNext();)
+ writeEntry(result, (JarEntry) i.next(), targetJar);
+ } finally {
+ if (result != null)
+ result.close();
+ }
} catch (IOException e) {
e.printStackTrace();
return;
@@ -95,8 +110,8 @@ public class DeltaComputer {
}
private void computeDelta() {
- ArrayList changes = new ArrayList();
- ArrayList additions = new ArrayList();
+ changes = new ArrayList();
+ additions = new ArrayList();
// start out assuming that all the base entries are being removed
baseEntries = getEntries(baseJar);
for (Enumeration e = targetJar.entries(); e.hasMoreElements();) {
@@ -145,25 +160,30 @@ public class DeltaComputer {
return;
}
// now we know each JAR has an entry for the name, compare and see how/if they differ
- boolean changed = equals(entry, baseEntry);
+ boolean changed = !equals(entry, baseEntry);
if (changed)
changes.add(entry);
- baseEntries.remove(baseEntry);
+ baseEntries.remove(baseEntry.getName());
}
// compare the two entries. We already know that they have the same name.
private boolean equals(JarEntry entry, JarEntry baseEntry) {
if (entry.getSize() != baseEntry.getSize())
return false;
- if (entry.getTime() != baseEntry.getTime())
+ // make sure the entries are of the same type
+ if (entry.isDirectory() != baseEntry.isDirectory())
return false;
+ // if the entries are files then compare the times.
+ if (!entry.isDirectory())
+ if (entry.getTime() != baseEntry.getTime())
+ return false;
return true;
}
private Set getEntries(JarFile jar) {
HashSet result = new HashSet(jar.size());
for (Enumeration e = jar.entries(); e.hasMoreElements();)
- result.add(e.nextElement());
+ result.add(((JarEntry) e.nextElement()).getName());
return result;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/JarDeltaOptimizerStep.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/JarDeltaOptimizerStep.java
new file mode 100644
index 000000000..968bb77e9
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/JarDeltaOptimizerStep.java
@@ -0,0 +1,122 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM - continuing development
+*******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
+
+import java.io.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.Activator;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff.AbstractDeltaDiffStep;
+import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
+import org.eclipse.equinox.p2.artifact.repository.*;
+
+/**
+ * The Pack200Packer expects an input containing normal ".jar" data.
+ */
+public class JarDeltaOptimizerStep extends AbstractDeltaDiffStep {
+ private static final String JAR_SUFFIX = ".jar"; //$NON-NLS-1$
+
+ private File incoming;
+ private OutputStream tempStream;
+
+ protected JarDeltaOptimizerStep(IArtifactRepository repository) {
+ super(repository);
+ }
+
+ public void write(int b) throws IOException {
+ OutputStream stream = getOutputStream();
+ stream.write(b);
+ }
+
+ private OutputStream getOutputStream() throws IOException {
+ if (tempStream != null)
+ return tempStream;
+ // store input stream in temporary file
+ incoming = File.createTempFile("p2.jardelta.optimizer.incoming", JAR_SUFFIX);
+ tempStream = new BufferedOutputStream(new FileOutputStream(incoming));
+ return tempStream;
+ }
+
+ private void performOptimization() throws IOException {
+ File predecessor = null;
+ File resultFile = null;
+ try {
+ // get the predecessor and perform the optimization into a temp file
+ predecessor = fetchPredecessor(new ArtifactDescriptor(key));
+ resultFile = File.createTempFile("p2.jardelta.optimizer.result", JAR_SUFFIX);
+ new DeltaComputer(predecessor, incoming, resultFile).run();
+
+ // now write the optimized content to the destination
+ if (resultFile.length() > 0) {
+ InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile));
+ FileUtils.copyStream(resultStream, true, destination, false);
+ } else {
+ status = new Status(IStatus.ERROR, Activator.ID, "Empty optimized file: " + resultFile);
+ }
+ } finally {
+ // if we have a predecessor and it is our temp file then clean up the file
+ if (predecessor != null && predecessor.getAbsolutePath().indexOf("p2.jardelta.predecessor") > -1)
+ predecessor.delete();
+ if (resultFile != null)
+ resultFile.delete();
+ }
+ }
+
+ private File fetchPredecessor(ArtifactDescriptor descriptor) {
+ if (repository instanceof IFileArtifactRepository)
+ return ((IFileArtifactRepository) repository).getArtifactFile(descriptor);
+ File result = null;
+ OutputStream resultStream = null;
+ try {
+ try {
+ result = File.createTempFile("p2.jardelta.predecessor", JAR_SUFFIX);
+ resultStream = new BufferedOutputStream(new FileOutputStream(result));
+ status = repository.getArtifact(descriptor, resultStream, monitor);
+ return result;
+ } finally {
+ if (resultStream != null)
+ resultStream.close();
+ }
+ } catch (IOException e) {
+ }
+ return null;
+ }
+
+ public void close() throws IOException {
+ // When we go to close we must have seen all the content we are going to see.
+ // If no one wrote to the temp stream then there is nothing to do. Be sure to delete the
+ // the temporary file if any.
+ if (tempStream == null) {
+ if (incoming != null)
+ incoming.delete();
+ return;
+ }
+
+ // So there is content. Close the temporary stream and perform the optimization.
+ // Performing the optimization should result in the new content being written to
+ // the destination. Make sure we delete the temporary file if any.
+ try {
+ tempStream.close();
+ performOptimization();
+ } finally {
+ if (incoming != null)
+ incoming.delete();
+ }
+
+ super.close();
+ // TODO need to get real status here. sometimes the optimizers do not give
+ // any reasonable return status
+ if (status == null)
+ status = Status.OK_STATUS;
+ }
+
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java
new file mode 100644
index 000000000..a321cd804
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jardelta/Optimizer.java
@@ -0,0 +1,241 @@
+/*******************************************************************************
+* Copyright (c) 2007 compeople AG and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* compeople AG (Stefan Liebig) - initial API and implementation
+* IBM Corporation - adaptation to JAR deltas and on-going development
+*******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.*;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff.ArtifactKeyDeSerializer;
+import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
+import org.eclipse.equinox.p2.artifact.repository.*;
+import org.eclipse.equinox.p2.artifact.repository.processing.*;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.osgi.framework.Version;
+
+public class Optimizer {
+
+ private IArtifactRepository repository;
+ private int width;
+ private int depth;
+
+ private static final String JAR_DELTA_FORMAT = "jarDelta"; //$NON-NLS-1$
+ private static final String JAR_DELTA_PATCH_STEP = "org.eclipse.equinox.p2.processing.JarDeltaPatchStep"; //$NON-NLS-1$
+
+ private static final Comparator ARTIFACT_DESCRIPTOR_VERSION_COMPARATOR = new ArtifactDescriptorVersionComparator();
+ private static final Comparator ARTIFACT_KEY_VERSION_COMPARATOR = new ArtifactKeyVersionComparator();
+
+ /**
+ * This optimizer performs delta generation based on (currently) jbdiff.
+ * The optimization can be controlled with the ´width´ and the ´depth´ parameter.
+ * ´width´ defines for how many ´related´ artifact keys a delta should be generated,
+ * starting from the most up-to-date.
+ * ´depth´ defines to how many predecessor a delta should be generated.
+ *
+ * With AK(c-v) : AK - artifact key, c - artifact id, v - artifact version
+ * the ´repository content´ can be viewed a two dimensional array, where the
+ * artifact keys for the same component are in order of their version:
+ * <pre><code>
+ * w=1 w=2
+ * | |
+ * | +------.------------+ d=2
+ * | | +----.---+ d=1 |
+ * | | | | | v
+ * [ v | | v v v
+ * [ AK(x,2.0) AK(x,1.5) AK(x,1.1) ]
+ * [ AK(y,2.0) AK(y,1.9) ]
+ * [ AK(z,2.0) AK(z,1.5) AK(z,1.3) AK(z,1.0) ]
+ * ]
+ * </code></pre>
+ * E.g: with a ´width´ of one and a ´depth´ of two the optimizer would
+ * create two deltas for component ´x´ from 1.5 to 2.0 and from 1.1 to 2.0.
+ *
+ * @param repository
+ * @param width
+ * @param depth
+ */
+ public Optimizer(IArtifactRepository repository, int width, int depth) {
+ this.repository = repository;
+ this.width = width;
+ this.depth = depth;
+ }
+
+ public void run() {
+ System.out.println("Starting delta (jardelta) optimizations (width=" + width + ", depth=" + depth + ")");
+ IArtifactKey[][] keys = getSortedRelatedArtifactKeys(repository.getArtifactKeys());
+ for (int i = 0; i < keys.length; i++) {
+ if (keys[i].length < 2)
+ // Nothing to diff here!
+ continue;
+ int minWidth = Math.min(width, keys[i].length);
+ for (int j = 0; j < minWidth; j++) {
+ IArtifactKey key = keys[i][j];
+ boolean isArchive = key.getClassifier().equals("plugin"); //$NON-NLS-1$
+ optimize(keys[i], key);
+ }
+ }
+ System.out.println("Done.");
+
+ }
+
+ private void optimize(IArtifactKey[] keys, IArtifactKey key) {
+ IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(key);
+ IArtifactDescriptor canonical = null;
+ for (int k = 0; k < descriptors.length; k++) {
+ IArtifactDescriptor descriptor = descriptors[k];
+ boolean optimized = false;
+ if (isCanonical(descriptor))
+ canonical = descriptor;
+ else
+ optimized |= isOptimized(descriptor);
+ if (!optimized)
+ optimize(canonical, keys);
+ }
+ }
+
+ private IArtifactKey getVersionlessKey(IArtifactKey key) {
+ return new ArtifactKey(key.getNamespace(), key.getClassifier(), key.getId(), Version.emptyVersion);
+ }
+
+ /**
+ * This method retrieves a list of list of IArtifactKeys. The artifact keys in the
+ * list of artifact keys are all ´strongly related´ to each other such that are
+ * equal but not considering the versions. This list is sorted such that the
+ * newer versions are first in the list.<p>
+ * With AK(c-v) : AK - artifact key, c - artifact id, v - artifact version
+ * the result is than, e.g.
+ * <pre><code>
+ * [
+ * [ AK(x,2.0) AK(x,1.5) AK(x,1.1) ]
+ * [ AK(y,2.0) AK(y,1.9) ]
+ * [ AK(z,2.0) AK(z,1.5) AK(z,1.3) AK(z,1.0) ]
+ * ]
+ * </code></pre>
+ * @param artifactKeys
+ * @return the sorted artifact keys
+ */
+ private IArtifactKey[][] getSortedRelatedArtifactKeys(IArtifactKey[] artifactKeys) {
+ Map map = new HashMap();
+ for (int i = 0; i < artifactKeys.length; i++) {
+ IArtifactKey freeKey = getVersionlessKey(artifactKeys[i]);
+ List values = (List) map.get(freeKey);
+ if (values == null) {
+ values = new ArrayList();
+ map.put(freeKey, values);
+ }
+ values.add(artifactKeys[i]);
+ }
+ IArtifactKey[][] lists = new IArtifactKey[map.size()][];
+ int i = 0;
+ for (Iterator iterator = map.values().iterator(); iterator.hasNext();) {
+ List artifactKeyList = (List) iterator.next();
+ IArtifactKey[] relatedArtifactKeys = (IArtifactKey[]) artifactKeyList.toArray(new IArtifactKey[artifactKeyList.size()]);
+ Arrays.sort(relatedArtifactKeys, ARTIFACT_KEY_VERSION_COMPARATOR);
+ lists[i++] = relatedArtifactKeys;
+ }
+ int candidates = 0;
+ for (int ii = 0; ii < lists.length; ii++) {
+ for (int jj = 0; jj < lists[ii].length; jj++) {
+ System.out.println(lists[ii][jj] + ", ");
+ }
+ System.out.println("");
+ if (lists[ii].length > 1)
+ candidates++;
+ }
+ System.out.println("Candidates found: " + candidates);
+ return lists;
+ }
+
+ private void optimize(IArtifactDescriptor canonical, IArtifactKey[] relatedArtifactKeys) {
+ System.out.println("Optimizing " + canonical);
+
+ IArtifactDescriptor[] descriptors = getSortedCompletePredecessors(canonical.getArtifactKey(), relatedArtifactKeys);
+
+ int minDepth = Math.min(depth, descriptors.length);
+ for (int i = 0; i < minDepth; i++) {
+ System.out.println("\t with jar delta against " + descriptors[i].getArtifactKey());
+ String predecessorData = ArtifactKeyDeSerializer.serialize(descriptors[i].getArtifactKey());
+ ArtifactDescriptor newDescriptor = new ArtifactDescriptor(canonical);
+ ProcessingStepDescriptor patchStep = new ProcessingStepDescriptor(JAR_DELTA_PATCH_STEP, predecessorData, true);
+ ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {patchStep};
+ newDescriptor.setProcessingSteps(steps);
+ newDescriptor.setProperty(IArtifactDescriptor.FORMAT, JAR_DELTA_FORMAT);
+ OutputStream repositoryStream = null;
+ try {
+ repositoryStream = repository.getOutputStream(newDescriptor);
+
+ // Add in all the processing steps needed to optimize (e.g., pack200, ...)
+ ProcessingStep optimizerStep = new JarDeltaOptimizerStep(repository);
+ optimizerStep.initialize(patchStep, newDescriptor);
+ ProcessingStepHandler handler = new ProcessingStepHandler();
+ OutputStream destination = handler.link(new ProcessingStep[] {optimizerStep}, repositoryStream, null);
+
+ // Do the actual work by asking the repo to get the artifact and put it in the destination.
+ repository.getArtifact(canonical, destination, new NullProgressMonitor());
+ } finally {
+ if (repositoryStream != null)
+ try {
+ repositoryStream.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
+ private IArtifactDescriptor[] getSortedCompletePredecessors(IArtifactKey artifactKey, IArtifactKey[] relatedArtifactKeys) {
+ // get all artifact keys
+ List completeDescriptors = new ArrayList(relatedArtifactKeys.length);
+ for (int i = 0; i < relatedArtifactKeys.length; i++) {
+ // if we find ´our self´ skip
+ if (relatedArtifactKeys[i].equals(artifactKey))
+ continue;
+ // look for a complete artifact descriptor of the current key
+ IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(relatedArtifactKeys[i]);
+ for (int j = 0; j < descriptors.length; j++) {
+ if (isCanonical(descriptors[j])) {
+ completeDescriptors.add(descriptors[j]);
+ break;
+ }
+ }
+ }
+
+ IArtifactDescriptor[] completeSortedDescriptors = (IArtifactDescriptor[]) completeDescriptors.toArray(new IArtifactDescriptor[completeDescriptors.size()]);
+ // Sort, so to allow a depth lookup!
+ Arrays.sort(completeSortedDescriptors, ARTIFACT_DESCRIPTOR_VERSION_COMPARATOR);
+ return completeSortedDescriptors;
+ }
+
+ private boolean isOptimized(IArtifactDescriptor descriptor) {
+ if (descriptor.getProcessingSteps().length != 1)
+ return false;
+ return JAR_DELTA_FORMAT.equals(descriptor.getProperty(IArtifactDescriptor.FORMAT));
+ }
+
+ private boolean isCanonical(IArtifactDescriptor descriptor) {
+ // TODO length != 0 is not necessarily an indicator for not being canonical!
+ return descriptor.getProcessingSteps().length == 0;
+ }
+
+ static final class ArtifactDescriptorVersionComparator implements Comparator {
+ public int compare(Object artifactDescriptor0, Object artifactDescriptor1) {
+ return -1 * ((IArtifactDescriptor) artifactDescriptor0).getArtifactKey().getVersion().compareTo(((IArtifactDescriptor) artifactDescriptor1).getArtifactKey().getVersion());
+ }
+ }
+
+ static final class ArtifactKeyVersionComparator implements Comparator {
+ public int compare(Object artifactKey0, Object artifactKey1) {
+ return -1 * ((IArtifactKey) artifactKey0).getVersion().compareTo(((IArtifactKey) artifactKey1).getVersion());
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/AbstractDeltaDiffStep.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/AbstractDeltaDiffStep.java
index acf6e24b9..0b53dfe8a 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/AbstractDeltaDiffStep.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/AbstractDeltaDiffStep.java
@@ -12,6 +12,7 @@ package org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.Activator;
import org.eclipse.equinox.p2.artifact.repository.IArtifactDescriptor;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStep;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Application.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Application.java
index dc657e124..1e328d9a1 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Application.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Application.java
@@ -12,6 +12,7 @@ import java.net.URL;
import java.util.Map;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.Activator;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepositoryManager;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java
index 698346f37..224cc978c 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/jbdiff/Optimizer.java
@@ -96,7 +96,7 @@ public class Optimizer {
IArtifactDescriptor complete = null;
for (int k = 0; k < descriptors.length; k++) {
IArtifactDescriptor descriptor = descriptors[k];
- if (isComplete(descriptor))
+ if (isCanonical(descriptor))
complete = descriptor;
else if (isOptimized(descriptor, proposedStrategy)) {
proposedStrategy = null;
@@ -219,7 +219,7 @@ public class Optimizer {
// look for a complete artifact descriptor of the current key
IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(relatedArtifactKeys[i]);
for (int j = 0; j < descriptors.length; j++) {
- if (isComplete(descriptors[j])) {
+ if (isCanonical(descriptors[j])) {
completeDescriptors.add(descriptors[j]);
break;
}
@@ -238,7 +238,7 @@ public class Optimizer {
return stepId.equals(descriptor.getProcessingSteps()[0].getProcessorId());
}
- private boolean isComplete(IArtifactDescriptor descriptor) {
+ private boolean isCanonical(IArtifactDescriptor descriptor) {
// TODO length != 0 is not necessarily an indicator for not being complete!
return descriptor.getProcessingSteps().length == 0;
}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java
deleted file mode 100644
index 91577f88d..000000000
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Activator.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 IBM Corporation and others. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;
-
-import org.osgi.framework.BundleActivator;
-import org.osgi.framework.BundleContext;
-
-public class Activator implements BundleActivator {
- public static final String ID = "org.eclipse.equinox.p2.artifact.optimizer.pack200"; //$NON-NLS-1$
- private static BundleContext context = null;
-
- public static BundleContext getContext() {
- return context;
- }
-
- public void start(BundleContext context) throws Exception {
- Activator.context = context;
- }
-
- public void stop(BundleContext context) throws Exception {
- }
-
-}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java
index ae0e7c37f..ed5194076 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Application.java
@@ -12,6 +12,7 @@ import java.net.URL;
import java.util.Map;
import org.eclipse.equinox.app.IApplication;
import org.eclipse.equinox.app.IApplicationContext;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.Activator;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepository;
import org.eclipse.equinox.p2.artifact.repository.IArtifactRepositoryManager;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
index a8ab38c40..15501dcc6 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Optimizer.java
@@ -31,19 +31,24 @@ public class Optimizer {
if (!key.getClassifier().equals("plugin"))
continue;
IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(key);
- IArtifactDescriptor complete = null;
+ IArtifactDescriptor canonical = null;
boolean optimized = false;
for (int j = 0; j < descriptors.length; j++) {
IArtifactDescriptor descriptor = descriptors[j];
- if (descriptor.getProcessingSteps().length == 0)
- complete = descriptor;
+ if (isCanonical(descriptor))
+ canonical = descriptor;
optimized |= isOptimized(descriptor);
}
if (!optimized)
- optimize(complete);
+ optimize(canonical);
}
}
+ private boolean isCanonical(IArtifactDescriptor descriptor) {
+ // TODO length != 0 is not necessarily an indicator for not being complete!
+ return descriptor.getProcessingSteps().length == 0;
+ }
+
private void optimize(IArtifactDescriptor descriptor) {
ArtifactDescriptor newDescriptor = new ArtifactDescriptor(descriptor);
ProcessingStepDescriptor[] steps = new ProcessingStepDescriptor[] {new ProcessingStepDescriptor("org.eclipse.equinox.p2.processing.Pack200Unpacker", null, true)};
diff --git a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java
index 9800352bc..cf11900c1 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.optimizers/src/org/eclipse/equinox/internal/p2/artifact/optimizers/pack200/Pack200Step.java
@@ -14,6 +14,7 @@ package org.eclipse.equinox.internal.p2.artifact.optimizers.pack200;
import java.io.*;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.Activator;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.p2.jarprocessor.JarProcessorExecutor;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF
index 2abf4541b..f7f3df000 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/META-INF/MANIFEST.MF
@@ -19,9 +19,10 @@ Import-Package: ie.wombat.jbdiff,
org.eclipse.equinox.p2.metadata,
org.eclipse.equinox.p2.sar
Bundle-Vendor: %providerName
-Export-Package: org.eclipse.equinox.internal.p2.artifact.processor.jardelta;x-internal:=true,
- org.eclipse.equinox.internal.p2.artifact.processor.pack200;x-internal:=true,
+Export-Package: org.eclipse.equinox.internal.p2.artifact.processors;x-internal:=true,
+ org.eclipse.equinox.internal.p2.artifact.processors.jardelta;x-internal:=true,
org.eclipse.equinox.internal.p2.artifact.processors.jbdiff;x-internal:=true,
- org.eclipse.equinox.p2.artifact.processors;x-internal:=true
-Bundle-Activator: org.eclipse.equinox.p2.artifact.processors.Activator
+ org.eclipse.equinox.internal.p2.artifact.processors.pack200;x-internal:=true,
+ org.eclipse.equinox.internal.p2.artifact.processors.verifier;x-internal:=true
+Bundle-Activator: org.eclipse.equinox.internal.p2.artifact.processors.Activator
Eclipse-LazyStart: true
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/plugin.xml b/bundles/org.eclipse.equinox.p2.artifact.processors/plugin.xml
index eb5f819a8..842276102 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/plugin.xml
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/plugin.xml
@@ -4,12 +4,12 @@
<extension
point="org.eclipse.equinox.p2.artifact.repository.processingSteps"
id="org.eclipse.equinox.p2.processing.Pack200Unpacker">
- <step class="org.eclipse.equinox.internal.p2.artifact.processor.pack200.Unpack200Step"/>
+ <step class="org.eclipse.equinox.internal.p2.artifact.processors.pack200.Unpack200Step"/>
</extension>
<extension
point="org.eclipse.equinox.p2.artifact.repository.processingSteps"
- id="org.eclipse.equinox.p2.processing.JarDeltaStep">
- <step class="org.eclipse.equinox.internal.p2.artifact.processor.jardelta.JarDeltaStep"/>
+ id="org.eclipse.equinox.p2.processing.JarDeltaPatchStep">
+ <step class="org.eclipse.equinox.internal.p2.artifact.processors.jardelta.JarDeltaProcessorStep"/>
</extension>
<extension
point="org.eclipse.equinox.p2.artifact.repository.processingSteps"
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/jardelta/JarDeltaStep.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/jardelta/JarDeltaStep.java
deleted file mode 100644
index 717c5ba95..000000000
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/jardelta/JarDeltaStep.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007 IBM Corporation and others.
-* All rights reserved. This program and the accompanying materials
-* are made available under the terms of the Eclipse Public License v1.0
-* which accompanies this distribution, and is available at
-* http://www.eclipse.org/legal/epl-v10.html
-*
-* Contributors:
-* IBM Corporation - initial API and implementation
-*******************************************************************************/
-package org.eclipse.equinox.internal.p2.artifact.processor.jardelta;
-
-import java.io.IOException;
-import org.eclipse.equinox.p2.artifact.repository.IArtifactDescriptor;
-import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStep;
-import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStepDescriptor;
-
-/**
- * Processor that taks a JAR delta and applies it.
- */
-public class JarDeltaStep extends ProcessingStep {
- public static final String ID = "org.eclipse.equinox.p2.artifact.processor.jardelta"; //$NON-NLS-1$
-
- public void close() throws IOException {
- }
-
- public void initialize(ProcessingStepDescriptor descriptor, IArtifactDescriptor context) {
- super.initialize(descriptor, context);
- }
-
- public void write(int b) throws IOException {
- // OutputStream stream = getOutputStream();
- // stream.write(b);
- }
-
-} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/p2/artifact/processors/Activator.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/Activator.java
index 3f1290720..1b5854b01 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/p2/artifact/processors/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/Activator.java
@@ -7,7 +7,7 @@
* Contributors: IBM Corporation - initial API and implementation
******************************************************************************/
-package org.eclipse.equinox.p2.artifact.processors;
+package org.eclipse.equinox.internal.p2.artifact.processors;
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java
new file mode 100644
index 000000000..5239807a1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/DeltaApplier.java
@@ -0,0 +1,157 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.processors.jardelta;
+
+import java.io.*;
+import java.util.*;
+import java.util.jar.*;
+
+public class DeltaApplier {
+ private static final String DELETE_SUFFIX = ".delete"; //$NON-NLS-1$
+ private File delta;
+ private File base;
+ private File destination;
+ private JarFile baseJar;
+ private JarFile deltaJar;
+ private Set baseEntries;
+
+ public DeltaApplier(File base, File delta, File destination) {
+ this.base = base;
+ this.delta = delta;
+ this.destination = destination;
+ }
+
+ public void run() {
+ try {
+ if (!openJars())
+ return;
+ applyDelta();
+ writeResult();
+ } finally {
+ closeJars();
+ }
+ }
+
+ private void applyDelta() {
+ // start out assuming that all the base entries will be moved over.
+ baseEntries = getEntries(baseJar);
+ // remove from the base all the entries that appear in the delta
+ for (Enumeration e = deltaJar.entries(); e.hasMoreElements();) {
+ JarEntry entry = ((JarEntry) e.nextElement());
+ String name = entry.getName();
+ if (name.endsWith(DELETE_SUFFIX))
+ name = name.substring(0, name.length() - DELETE_SUFFIX.length());
+ baseEntries.remove(name);
+ }
+ }
+
+ private void writeResult() {
+ JarOutputStream result = null;
+ try {
+ try {
+ result = new JarOutputStream(new FileOutputStream(destination));
+ // write out the things we know are staying from the base JAR
+ for (Iterator i = baseEntries.iterator(); i.hasNext();) {
+ JarEntry entry = baseJar.getJarEntry((String) i.next());
+ writeEntry(result, entry, baseJar);
+ }
+ // write out the changes/additions from the delta.
+ for (Enumeration e = deltaJar.entries(); e.hasMoreElements();) {
+ JarEntry entry = (JarEntry) e.nextElement();
+ if (!entry.getName().endsWith(DELETE_SUFFIX))
+ writeEntry(result, entry, deltaJar);
+ }
+ } finally {
+ if (result != null)
+ result.close();
+ }
+ } catch (IOException e) {
+ e.printStackTrace();
+ return;
+ }
+ }
+
+ private void writeEntry(JarOutputStream result, JarEntry entry, JarFile sourceJar) throws IOException {
+ // add the entry
+ result.putNextEntry(entry);
+ try {
+ // if there is a sourceJar copy over the content for the entry into the result
+ if (sourceJar != null) {
+ InputStream contents = sourceJar.getInputStream(entry);
+ try {
+ transferStreams(contents, result);
+ } finally {
+ contents.close();
+ }
+ }
+ } finally {
+ result.closeEntry();
+ }
+ }
+
+ /**
+ * Transfers all available bytes from the given input stream to the given
+ * output stream. Does not close either stream.
+ *
+ * @param source
+ * @param destination
+ * @throws IOException
+ */
+ public static void transferStreams(InputStream source, OutputStream destination) throws IOException {
+ source = new BufferedInputStream(source);
+ destination = new BufferedOutputStream(destination);
+ try {
+ byte[] buffer = new byte[8192];
+ while (true) {
+ int bytesRead = -1;
+ if ((bytesRead = source.read(buffer)) == -1)
+ break;
+ destination.write(buffer, 0, bytesRead);
+ }
+ } finally {
+ destination.flush();
+ }
+ }
+
+ private boolean openJars() {
+ try {
+ baseJar = new JarFile(base);
+ deltaJar = new JarFile(delta);
+ } catch (IOException e) {
+ return false;
+ }
+ return true;
+ }
+
+ private void closeJars() {
+ if (baseJar != null)
+ try {
+ baseJar.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ if (deltaJar != null)
+ try {
+ deltaJar.close();
+ } catch (IOException e) {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ }
+
+ private Set getEntries(JarFile jar) {
+ HashSet result = new HashSet(jar.size());
+ for (Enumeration e = jar.entries(); e.hasMoreElements();)
+ result.add(((JarEntry) e.nextElement()).getName());
+ return result;
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/JarDeltaProcessorStep.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/JarDeltaProcessorStep.java
new file mode 100644
index 000000000..8e97b668e
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jardelta/JarDeltaProcessorStep.java
@@ -0,0 +1,116 @@
+/*******************************************************************************
+* Copyright (c) 2007 IBM Corporation and others.
+* All rights reserved. This program and the accompanying materials
+* are made available under the terms of the Eclipse Public License v1.0
+* which accompanies this distribution, and is available at
+* http://www.eclipse.org/legal/epl-v10.html
+*
+* Contributors:
+* IBM Corporation - initial API and implementation
+*******************************************************************************/
+package org.eclipse.equinox.internal.p2.artifact.processors.jardelta;
+
+import java.io.*;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.artifact.processors.Activator;
+import org.eclipse.equinox.internal.p2.artifact.processors.jbdiff.AbstractDeltaPatchStep;
+import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
+import org.eclipse.equinox.p2.artifact.repository.ArtifactDescriptor;
+import org.eclipse.equinox.p2.artifact.repository.IFileArtifactRepository;
+
+/**
+ * Processor that takes a JAR delta and applies it.
+ */
+public class JarDeltaProcessorStep extends AbstractDeltaPatchStep {
+ private static final String JAR_SUFFIX = ".jar"; //$NON-NLS-1$
+
+ private File incoming;
+ private OutputStream tempStream;
+
+ public void write(int b) throws IOException {
+ OutputStream stream = getOutputStream();
+ stream.write(b);
+ }
+
+ private OutputStream getOutputStream() throws IOException {
+ if (tempStream != null)
+ return tempStream;
+ // store input stream in temporary file
+ incoming = File.createTempFile("p2.jardelta.processor.incoming", JAR_SUFFIX);
+ tempStream = new BufferedOutputStream(new FileOutputStream(incoming));
+ return tempStream;
+ }
+
+ public void close() throws IOException {
+ // When we go to close we must have seen all the content we are going to see.
+ // If no one wrote to the temp stream then there is nothing to do. Be sure to delete the
+ // the temporary file if any.
+ if (tempStream == null) {
+ if (incoming != null)
+ incoming.delete();
+ return;
+ }
+
+ // So there is content. Close the temporary stream and perform the optimization.
+ // Performing the optimization should result in the new content being written to
+ // the destination. Make sure we delete the temporary file if any.
+ try {
+ tempStream.close();
+ performPatch();
+ } finally {
+ if (incoming != null)
+ incoming.delete();
+ }
+
+ super.close();
+ // TODO need to get real status here. sometimes the optimizers do not give
+ // any reasonable return status
+ if (status == null)
+ status = Status.OK_STATUS;
+ }
+
+ private void performPatch() throws IOException {
+ File predecessor = null;
+ File resultFile = null;
+ try {
+ // get the predecessor and perform the optimization into a temp file
+ predecessor = fetchPredecessor(new ArtifactDescriptor(key));
+ resultFile = File.createTempFile("p2.jardelta.processor.result", JAR_SUFFIX);
+ new DeltaApplier(predecessor, incoming, resultFile).run();
+
+ // now write the optimized content to the destination
+ if (resultFile.length() > 0) {
+ InputStream resultStream = new BufferedInputStream(new FileInputStream(resultFile));
+ FileUtils.copyStream(resultStream, true, destination, false);
+ } else {
+ status = new Status(IStatus.ERROR, Activator.ID, "Empty optimized file: " + resultFile);
+ }
+ } finally {
+ if (predecessor != null)
+ predecessor.delete();
+ if (resultFile != null)
+ resultFile.delete();
+ }
+ }
+
+ private File fetchPredecessor(ArtifactDescriptor descriptor) {
+ if (repository instanceof IFileArtifactRepository)
+ return ((IFileArtifactRepository) repository).getArtifactFile(descriptor);
+ File result = null;
+ OutputStream resultStream = null;
+ try {
+ try {
+ result = File.createTempFile("p2.jardelta.predecessor", JAR_SUFFIX);
+ resultStream = new BufferedOutputStream(new FileOutputStream(result));
+ status = repository.getArtifact(descriptor, resultStream, monitor);
+ return result;
+ } finally {
+ if (resultStream != null)
+ resultStream.close();
+ }
+ } catch (IOException e) {
+ }
+ return null;
+ }
+} \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jbdiff/AbstractDeltaPatchStep.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jbdiff/AbstractDeltaPatchStep.java
index 8d2287f2f..2cc3e3369 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jbdiff/AbstractDeltaPatchStep.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/jbdiff/AbstractDeltaPatchStep.java
@@ -12,8 +12,8 @@ package org.eclipse.equinox.internal.p2.artifact.processors.jbdiff;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
+import org.eclipse.equinox.internal.p2.artifact.processors.Activator;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
-import org.eclipse.equinox.p2.artifact.processors.Activator;
import org.eclipse.equinox.p2.artifact.repository.*;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStepDescriptor;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/pack200/Unpack200Step.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Unpack200Step.java
index c3bf77c9a..c79d78d48 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processor/pack200/Unpack200Step.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/pack200/Unpack200Step.java
@@ -9,7 +9,7 @@
* compeople AG (Stefan Liebig) - initial API and implementation
* IBM - continuing development
*******************************************************************************/
-package org.eclipse.equinox.internal.p2.artifact.processor.pack200;
+package org.eclipse.equinox.internal.p2.artifact.processors.pack200;
import java.io.*;
import org.eclipse.core.runtime.IStatus;
diff --git a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/verifier/MD5Verifier.java b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/verifier/MD5Verifier.java
index bcfeabdf4..f098c4bb0 100644
--- a/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/verifier/MD5Verifier.java
+++ b/bundles/org.eclipse.equinox.p2.artifact.processors/src/org/eclipse/equinox/internal/p2/artifact/processors/verifier/MD5Verifier.java
@@ -16,7 +16,7 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
-import org.eclipse.equinox.p2.artifact.processors.Activator;
+import org.eclipse.equinox.internal.p2.artifact.processors.Activator;
import org.eclipse.equinox.p2.artifact.repository.IArtifactDescriptor;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStep;
import org.eclipse.equinox.p2.artifact.repository.processing.ProcessingStepDescriptor;
diff --git a/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
index c4034b18c..2f6c463b0 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.metadata/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
Bundle-Version: 0.1.0.qualifier
-Export-Package: org.eclipse.equinox.internal.p2.metadata;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.metadata.repository,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.artifact.repository",
+Export-Package: org.eclipse.equinox.internal.p2.metadata;x-friends:="org.eclipse.equinox.p2.metadata.generator,org.eclipse.equinox.p2.metadata.repository,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.artifact.optimizers",
org.eclipse.equinox.p2.metadata,
org.eclipse.equinox.p2.query,
org.eclipse.equinox.p2.resolution
diff --git a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ArtifactKey.java b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ArtifactKey.java
index aa089edb6..f34182859 100644
--- a/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ArtifactKey.java
+++ b/bundles/org.eclipse.equinox.p2.metadata/src/org/eclipse/equinox/internal/p2/metadata/ArtifactKey.java
@@ -70,10 +70,10 @@ public class ArtifactKey implements IArtifactKey {
}
public boolean equals(Object obj) {
- if (!(obj instanceof ArtifactKey))
+ if (!(obj instanceof IArtifactKey))
return false;
- ArtifactKey ak = (ArtifactKey) obj;
- return ak.id.equals(id) && ak.getVersion().equals(getVersion()) && ak.namespace.equals(namespace) && ak.classifier.equals(classifier);
+ IArtifactKey ak = (IArtifactKey) obj;
+ return ak.getId().equals(id) && ak.getVersion().equals(getVersion()) && ak.getNamespace().equals(namespace) && ak.getClassifier().equals(classifier);
}
public String getId() {
diff --git a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
index c48b9b768..8cebf0232 100644
--- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
@@ -10,9 +10,9 @@ Import-Package: ie.wombat.jbdiff,
org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta,
org.eclipse.equinox.internal.p2.artifact.optimizers.jbdiff,
org.eclipse.equinox.internal.p2.artifact.optimizers.pack200,
- org.eclipse.equinox.internal.p2.artifact.processor.jardelta,
- org.eclipse.equinox.internal.p2.artifact.processor.pack200,
+ org.eclipse.equinox.internal.p2.artifact.processors.jardelta,
org.eclipse.equinox.internal.p2.artifact.processors.jbdiff,
+ org.eclipse.equinox.internal.p2.artifact.processors.pack200,
org.eclipse.equinox.internal.p2.artifact.repository,
org.eclipse.equinox.internal.p2.core.helpers,
org.eclipse.equinox.internal.p2.director,
@@ -48,8 +48,7 @@ Require-Bundle: org.eclipse.equinox.p2.metadata.generator,
org.eclipse.equinox.p2.download
Eclipse-LazyStart: true
Eclipse-RegisterBuddy: org.eclipse.equinox.p2.artifact.repository
-Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,
- J2SE-1.4
+Bundle-RequiredExecutionEnvironment: J2SE-1.4
Export-Package: org.eclipse.equinox.p2.tests,
org.eclipse.equinox.p2.tests.artifact.optimizers.jbdiff,
org.eclipse.equinox.p2.tests.artifact.optimizers.pack200,
diff --git a/bundles/org.eclipse.equinox.p2.tests/rawData/Test Data Generator.launch b/bundles/org.eclipse.equinox.p2.tests/rawData/Test Data Generator.launch
index df6cd75ff..ad9a6a439 100644
--- a/bundles/org.eclipse.equinox.p2.tests/rawData/Test Data Generator.launch
+++ b/bundles/org.eclipse.equinox.p2.tests/rawData/Test Data Generator.launch
@@ -9,15 +9,17 @@
<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/Test Data Generator"/>
<booleanAttribute key="default_auto_start" value="false"/>
<intAttribute key="default_start_level" value="4"/>
+<stringAttribute key="execEnvironment" value="J2SE-1.5"/>
<booleanAttribute key="includeOptional" value="false"/>
<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-application org.eclipse.equinox.p2.metadata.generator.EclipseGenerator&#13;&#10;-metadataRepository file:${workspace_loc:org.eclipse.equinox.p2.tests/testData/enginerepo}&#13;&#10;-artifactRepository file:${workspace_loc:org.eclipse.equinox.p2.tests/testData/enginerepo} &#13;&#10;-base ${workspace_loc:org.eclipse.equinox.p2.tests/rawData}&#13;&#10;-bundles ${workspace_loc:org.eclipse.equinox.p2.tests/rawData}&#13;&#10;-features ${workspace_loc:org.eclipse.equinox.p2.tests/rawData}&#13;&#10;-publishArtifacts &#13;&#10;-par&#13;&#10;-noDefaultIUs"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
<stringAttribute key="pde.version" value="3.3"/>
+<booleanAttribute key="show_selected_only" value="false"/>
<stringAttribute key="target_bundles" value="org.eclipse.core.contenttype@default:default,org.eclipse.core.jobs@default:default,org.eclipse.core.runtime@default:default,org.eclipse.core.runtime.compatibility.registry@default:default,org.eclipse.equinox.app@default:true,org.eclipse.equinox.common@default:default,org.eclipse.equinox.launcher@default:default,org.eclipse.equinox.launcher.win32.win32.x86@default:default,org.eclipse.equinox.preferences@default:default,org.eclipse.equinox.registry@default:default,org.eclipse.osgi@:,org.eclipse.osgi.services@default:default,org.eclipse.update.configurator@default:default"/>
<booleanAttribute key="tracing" value="false"/>
<booleanAttribute key="useDefaultConfigArea" value="true"/>
-<booleanAttribute key="useNamedJRE" value="true"/>
+<booleanAttribute key="useNamedJRE" value="false"/>
<stringAttribute key="vminstall" value="ibm1.5sr1"/>
-<stringAttribute key="workspace_bundles" value="com.thoughtworks.xstream@default:default,org.eclipse.ecf@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:true,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.download@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.p2.metadata.repository@default:default"/>
+<stringAttribute key="workspace_bundles" value="org.eclipse.ecf@default:default,org.eclipse.ecf.filetransfer@default:default,org.eclipse.ecf.identity@default:default,org.eclipse.equinox.frameworkadmin@default:default,org.eclipse.equinox.frameworkadmin.equinox@default:true,org.eclipse.equinox.p2.artifact.repository@default:default,org.eclipse.equinox.p2.core@default:default,org.eclipse.equinox.p2.download@default:default,org.eclipse.equinox.p2.engine@default:default,org.eclipse.equinox.p2.metadata@default:default,org.eclipse.equinox.p2.metadata.generator@default:default,org.eclipse.equinox.p2.metadata.repository@default:default"/>
</launchConfiguration>
diff --git a/bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.1.jar b/bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.1.jar
new file mode 100644
index 000000000..49e7f90a2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.1.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.2.jar b/bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.2.jar
new file mode 100644
index 000000000..3515b0f46
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/rawData/testdata_1.0.0.2.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/AllTests.java
index 6b1b35852..f0624bed3 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/AllTests.java
@@ -19,7 +19,8 @@ public class AllTests extends TestCase {
public static Test suite() {
TestSuite suite = new TestSuite(AllTests.class.getName());
- suite.addTestSuite(PackRepositoryTest.class);
+ // suite.addTestSuite(PackRepositoryTest.class);
+ suite.addTestSuite(JarDeltaRepositoryTest.class);
return suite;
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/JarDeltaRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/JarDeltaRepositoryTest.java
new file mode 100644
index 000000000..d8e49c0e0
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/JarDeltaRepositoryTest.java
@@ -0,0 +1,137 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.artifact.optimizers.pack200;
+
+import java.io.*;
+import java.net.URL;
+import junit.framework.TestCase;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.equinox.internal.p2.artifact.optimizers.jardelta.Optimizer;
+import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
+import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
+import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
+import org.eclipse.equinox.p2.artifact.repository.*;
+import org.eclipse.equinox.p2.metadata.IArtifactKey;
+import org.eclipse.equinox.p2.tests.TestActivator;
+import org.eclipse.osgi.service.urlconversion.URLConverter;
+import org.osgi.framework.Version;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class JarDeltaRepositoryTest extends TestCase {
+ private ServiceTracker managerTracker;
+ private File workDir;
+
+ public JarDeltaRepositoryTest(String name) {
+ super(name);
+ }
+
+ public JarDeltaRepositoryTest() {
+ super("");
+ }
+
+ protected void setUp() throws Exception {
+ managerTracker = new ServiceTracker(TestActivator.getContext(), IArtifactRepositoryManager.class.getName(), null);
+ managerTracker.open();
+ }
+
+ protected void tearDown() throws Exception {
+ managerTracker.close();
+ if (workDir != null)
+ FileUtils.deleteAll(workDir);
+ }
+
+ public void testJarURLRepository() {
+ URL repositoryJar = TestActivator.getContext().getBundle().getEntry("/testData/enginerepo.zip");
+ URL repositoryURL = extractRepositoryJAR(repositoryJar);
+ assertNotNull("Could not extract repository", repositoryURL);
+ IArtifactRepository repository = ((IArtifactRepositoryManager) managerTracker.getService()).loadRepository(repositoryURL, null);
+ IArtifactKey key = new ArtifactKey("eclipse", "plugin", "testdata", new Version("1.0.0.2"));
+ IArtifactDescriptor[] descriptors = repository.getArtifactDescriptors(key);
+ assertTrue("Artifact Descriptor for engine missing", descriptors.length == 1);
+
+ new Optimizer(repository, 1, 1).run();
+ descriptors = repository.getArtifactDescriptors(key);
+ assertTrue("Optimization was a no-op", descriptors.length == 2);
+
+ IArtifactDescriptor canonical = null;
+ IArtifactDescriptor optimized = null;
+ for (int i = 0; i < descriptors.length; i++) {
+ if (descriptors[i].getProcessingSteps().length == 0)
+ canonical = descriptors[i];
+ else
+ optimized = descriptors[i];
+ }
+
+ assertTrue("Optmized descriptor not found", optimized != null);
+ assertTrue("Canonical descriptor not found", canonical != null);
+ long optimizedSize = Long.parseLong(optimized.getProperty(IArtifactDescriptor.DOWNLOAD_SIZE));
+ long canonicalSize = Long.parseLong(canonical.getProperty(IArtifactDescriptor.DOWNLOAD_SIZE));
+ assertTrue("Optimzed not smaller than canonical", optimizedSize < canonicalSize);
+
+ File canonicalFile = fetchArtifact("canonical", canonical);
+ File optimizedFile = fetchArtifact("optimized", optimized);
+ compareFiles(canonicalFile, optimizedFile);
+ }
+
+ private URL extractRepositoryJAR(URL source) {
+ String filter = "(protocol=" + source.getProtocol() + ")";
+ URLConverter converter = (URLConverter) ServiceHelper.getService(TestActivator.getContext(), URLConverter.class.getName(), filter);
+ try {
+ if (converter == null)
+ return null;
+ URL repoURL = converter.toFileURL(source);
+ if (!repoURL.toExternalForm().endsWith(".jar") && !repoURL.toExternalForm().endsWith(".zip"))
+ return repoURL;
+ // else the repo is a JAR or zip and we should extract the contents to a work dir.
+ File repoLocation = getWorkDir();
+ FileUtils.unzipFile(new File(repoURL.getPath()), repoLocation);
+ return repoLocation.toURL();
+ } catch (IOException e) {
+ return null;
+ }
+ }
+
+ private void compareFiles(File canonicalFile, File optimizedFile) {
+ assertTrue("Canonical file does not exist", canonicalFile.exists());
+ assertTrue("Optimized file does not exist", optimizedFile.exists());
+ assertEquals(canonicalFile.length(), optimizedFile.length());
+ // TODO compare the actual content
+ }
+
+ private File fetchArtifact(String name, IArtifactDescriptor descriptor) {
+ try {
+ File result = new File(getWorkDir(), name);
+ OutputStream destination = new BufferedOutputStream(new FileOutputStream(result));
+ try {
+ descriptor.getRepository().getArtifact(descriptor, destination, new NullProgressMonitor());
+ return result;
+ } finally {
+ if (destination != null)
+ destination.close();
+ }
+ } catch (IOException e) {
+ fail("Could not fetch artifact " + descriptor);
+ }
+ return null;
+ }
+
+ private File getWorkDir() throws IOException {
+ if (workDir != null)
+ return workDir;
+ workDir = File.createTempFile("work", "");
+ if (!workDir.delete())
+ throw new IOException("Could not delete file for creating temporary working dir.");
+ if (!workDir.mkdirs())
+ throw new IOException("Could not create temporary working dir.");
+ return workDir;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/PackRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/PackRepositoryTest.java
index 9a5e8adb8..7c90e31bd 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/PackRepositoryTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/optimizers/pack200/PackRepositoryTest.java
@@ -1,3 +1,13 @@
+/*******************************************************************************
+ * Copyright (c) 2007 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
package org.eclipse.equinox.p2.tests.artifact.optimizers.pack200;
import java.io.*;
@@ -5,6 +15,7 @@ import java.net.URL;
import junit.framework.TestCase;
import org.eclipse.core.runtime.NullProgressMonitor;
import org.eclipse.equinox.internal.p2.artifact.optimizers.pack200.Optimizer;
+import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper;
import org.eclipse.equinox.internal.p2.metadata.ArtifactKey;
import org.eclipse.equinox.p2.artifact.repository.*;
@@ -29,21 +40,17 @@ public class PackRepositoryTest extends TestCase {
protected void setUp() throws Exception {
managerTracker = new ServiceTracker(TestActivator.getContext(), IArtifactRepositoryManager.class.getName(), null);
managerTracker.open();
- workDir = File.createTempFile("work", "");
- if (!workDir.delete())
- throw new IOException("Could not delete file for creating temporary working dir.");
- if (!workDir.mkdirs())
- throw new IOException("Could not create temporary working dir.");
-
}
protected void tearDown() throws Exception {
managerTracker.close();
+ if (workDir != null)
+ FileUtils.deleteAll(workDir);
}
public void testJarURLRepository() {
- URL repositoryJar = TestActivator.getContext().getBundle().getEntry("/testData/enginerepo");
- URL repositoryURL = extractRepositoryJAR(repositoryJar, workDir);
+ URL repositoryJar = TestActivator.getContext().getBundle().getEntry("/testData/enginerepo.zip");
+ URL repositoryURL = extractRepositoryJAR(repositoryJar);
assertNotNull("Could not extract repository", repositoryURL);
IArtifactRepository repository = ((IArtifactRepositoryManager) managerTracker.getService()).loadRepository(repositoryURL, null);
IArtifactKey key = new ArtifactKey("eclipse", "plugin", "org.eclipse.equinox.prov.engine", new Version("0.1.0.200709241631"));
@@ -70,15 +77,23 @@ public class PackRepositoryTest extends TestCase {
assertTrue("Optimzed not smaller than canonical", optimizedSize < canonicalSize);
File canonicalFile = fetchArtifact("canonical", canonical);
- File optimizedFile = fetchArtifact("optimized", canonical);
+ File optimizedFile = fetchArtifact("optimized", optimized);
compareFiles(canonicalFile, optimizedFile);
}
- private URL extractRepositoryJAR(URL source, File destination) {
+ private URL extractRepositoryJAR(URL source) {
String filter = "(protocol=" + source.getProtocol() + ")";
URLConverter converter = (URLConverter) ServiceHelper.getService(TestActivator.getContext(), URLConverter.class.getName(), filter);
try {
- return converter == null ? null : converter.toFileURL(source);
+ if (converter == null)
+ return null;
+ URL repoURL = converter.toFileURL(source);
+ if (!repoURL.toExternalForm().endsWith(".jar") && !repoURL.toExternalForm().endsWith(".zip"))
+ return repoURL;
+ // else the repo is a JAR or zip and we should extract the contents to a work dir.
+ File repoLocation = getWorkDir();
+ FileUtils.unzipFile(new File(repoURL.getPath()), repoLocation);
+ return repoLocation.toURL();
} catch (IOException e) {
return null;
}
@@ -93,7 +108,7 @@ public class PackRepositoryTest extends TestCase {
private File fetchArtifact(String name, IArtifactDescriptor descriptor) {
try {
- File result = new File(workDir, name);
+ File result = new File(getWorkDir(), name);
OutputStream destination = new BufferedOutputStream(new FileOutputStream(result));
try {
descriptor.getRepository().getArtifact(descriptor, destination, new NullProgressMonitor());
@@ -107,4 +122,15 @@ public class PackRepositoryTest extends TestCase {
}
return null;
}
+
+ private File getWorkDir() throws IOException {
+ if (workDir != null)
+ return workDir;
+ workDir = File.createTempFile("work", "");
+ if (!workDir.delete())
+ throw new IOException("Could not delete file for creating temporary working dir.");
+ if (!workDir.mkdirs())
+ throw new IOException("Could not create temporary working dir.");
+ return workDir;
+ }
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java
index 0e25e9d25..246b796a9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/artifact/repository/processing/ProcessingStepHandlerTest.java
@@ -15,7 +15,7 @@ import java.io.*;
import java.util.Arrays;
import junit.framework.TestCase;
import org.eclipse.core.runtime.*;
-import org.eclipse.equinox.internal.p2.artifact.processor.pack200.Unpack200Step;
+import org.eclipse.equinox.internal.p2.artifact.processors.pack200.Unpack200Step;
import org.eclipse.equinox.internal.p2.core.helpers.FileUtils;
import org.eclipse.equinox.p2.artifact.repository.processing.*;
import org.eclipse.equinox.p2.tests.TestActivator;
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.jar b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.jar
index fb7b593d7..c77626027 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.jar
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.zip b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.zip
new file mode 100644
index 000000000..afbb1afeb
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo.zip
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/artifacts.xml b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/artifacts.xml
index 5cc03fc37..f52003e6a 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/artifacts.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/artifacts.xml
@@ -1,49 +1,29 @@
-<org.eclipse.equinox.internal.p2.artifact.repository.SimpleArtifactRepository>
- <mappingRules>
- <string-array>
- <string>(&amp; (namespace=eclipse) (classifier=plugin))</string>
- <string>${repoUrl}/plugins/${id}_${version}.jar</string>
- </string-array>
- <string-array>
- <string>(&amp; (namespace=eclipse) (classifier=native))</string>
- <string>${repoUrl}/native/${id}_${version}</string>
- </string-array>
- <string-array>
- <string>(&amp; (namespace=eclipse) (classifier=feature))</string>
- <string>${repoUrl}/features/${id}_${version}.jar</string>
- </string-array>
- </mappingRules>
- <artifactDescriptors>
- <org.eclipse.equinox.p2.artifact.repository.ArtifactDescriptor>
- <key class="org.eclipse.equinox.internal.p2.metadata.ArtifactKey">
- <namespace>eclipse</namespace>
- <id>org.eclipse.equinox.prov.engine</id>
- <classifier>plugin</classifier>
- <version>0.1.0.200709241631</version>
- </key>
- <processingSteps/>
- <properties>
- <entry>
- <string>download.size</string>
- <string>51366</string>
- </entry>
- <entry>
- <string>artifact.size</string>
- <string>51366</string>
- </entry>
+<?xml version='1.0' encoding='UTF-8'?>
+<?artifactRepository class='org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository' version='0.0.1'?>
+<repository name='file:D:\workspaces\prov.selfhost\org.eclipse.equinox.p2.tests\testData\enginerepo - artifacts' type='org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository' version='1.0.0'>
+ <mappings size='3'>
+ <rule filter='(&amp; (namespace=eclipse) (classifier=plugin))' output='${repoUrl}/plugins/${id}_${version}.jar'/>
+ <rule filter='(&amp; (namespace=eclipse) (classifier=native))' output='${repoUrl}/native/${id}_${version}'/>
+ <rule filter='(&amp; (namespace=eclipse) (classifier=feature))' output='${repoUrl}/features/${id}_${version}.jar'/>
+ </mappings>
+ <artifacts size='3'>
+ <artifact namespace='eclipse' classifier='plugin' id='testdata' version='1.0.0.2'>
+ <properties size='2'>
+ <property name='artifact.size' value='1939'/>
+ <property name='download.size' value='1939'/>
</properties>
- </org.eclipse.equinox.p2.artifact.repository.ArtifactDescriptor>
- </artifactDescriptors>
- <signatureVerification>false</signatureVerification>
- <blobStore>
- <store>file:D:/workspaces/prov.selfhost/org.eclipse.equinox.p2.tests/testData/enginerepo/.blobstore/</store>
- <fileBased>true</fileBased>
- <mask>127</mask>
- </blobStore>
- <name>file:D:\workspaces\prov.selfhost\org.eclipse.equinox.p2.tests\testData\enginerepo - artifacts</name>
- <type>org.eclipse.equinox.internal.p2.artifact.repository.SimpleArtifactRepository</type>
- <version>1</version>
- <description></description>
- <provider></provider>
- <properties/>
-</org.eclipse.equinox.internal.p2.artifact.repository.SimpleArtifactRepository> \ No newline at end of file
+ </artifact>
+ <artifact namespace='eclipse' classifier='plugin' id='org.eclipse.equinox.prov.engine' version='0.1.0.200709241631'>
+ <properties size='2'>
+ <property name='artifact.size' value='51366'/>
+ <property name='download.size' value='51366'/>
+ </properties>
+ </artifact>
+ <artifact namespace='eclipse' classifier='plugin' id='testdata' version='1.0.0.1'>
+ <properties size='2'>
+ <property name='artifact.size' value='1958'/>
+ <property name='download.size' value='1958'/>
+ </properties>
+ </artifact>
+ </artifacts>
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/content.xml
index 9a13f213d..e60920027 100644
--- a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/content.xml
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/content.xml
@@ -1,207 +1,276 @@
-<org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository>
- <units>
- <org.eclipse.equinox.p2.metadata.InstallableUnit>
- <id>org.eclipse.equinox.prov.engine</id>
- <version>0.1.0.200709241631</version>
- <singleton>true</singleton>
- <properties>
- <propertyMap>
- <entry>
- <string>equinox.p2.update.from</string>
- <string>org.eclipse.equinox.prov.engine</string>
- </entry>
- <entry>
- <string>equinox.p2.update.range</string>
- <string>0.0.0</string>
- </entry>
- <entry>
- <string>equinox.p2.name</string>
- <string>Engine Plug-in (Incubation)</string>
- </entry>
- </propertyMap>
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository class='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='0.0.1'?>
+<repository name='file:D:\workspaces\prov.selfhost\org.eclipse.equinox.p2.tests\testData\enginerepo - metadata' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1.0.0'>
+ <units size='5'>
+ <unit id='a.jre' version='1.5.0' singleton='false'>
+ <provides size='119'>
+ <provided namespace='org.eclipse.equinox.p2.iunamespace' name='a.jre' version='1.5.0'/>
+ <provided namespace='osgi.packages' name='javax.accessibility' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.activity' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.crypto' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.crypto.interfaces' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.crypto.spec' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio.event' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio.metadata' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio.plugins.bmp' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio.plugins.jpeg' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio.spi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.imageio.stream' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.loading' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.modelmbean' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.monitor' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.openmbean' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.relation' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.remote' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.remote.rmi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.management.timer' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.naming' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.naming.directory' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.naming.event' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.naming.ldap' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.naming.spi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.net' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.net.ssl' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.print' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.print.attribute' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.print.attribute.standard' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.print.event' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.rmi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.rmi.CORBA' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.rmi.ssl' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.auth' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.auth.callback' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.auth.kerberos' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.auth.login' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.auth.spi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.auth.x500' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.cert' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.security.sasl' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.servlet' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.servlet.http' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sound.midi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sound.midi.spi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sound.sampled' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sound.sampled.spi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sql' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sql.rowset' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sql.rowset.serial' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.sql.rowset.spi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.border' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.colorchooser' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.event' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.filechooser' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.plaf' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.plaf.basic' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.plaf.metal' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.plaf.multi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.plaf.synth' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.table' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.text' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.text.html' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.text.html.parser' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.text.rtf' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.tree' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.swing.undo' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.transaction' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.transaction.xa' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.datatype' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.namespace' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.parsers' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.transform' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.transform.dom' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.transform.sax' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.transform.stream' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.validation' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='javax.xml.xpath' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.ietf.jgss' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA_2_3' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA_2_3.portable' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA.DynAnyPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA.ORBPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA.portable' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CORBA.TypeCodePackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CosNaming' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CosNaming.NamingContextExtPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.CosNaming.NamingContextPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.Dynamic' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.DynamicAny' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.DynamicAny.DynAnyFactoryPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.DynamicAny.DynAnyPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.IOP' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.IOP.CodecFactoryPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.IOP.CodecPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.Messaging' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableInterceptor' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableInterceptor.ORBInitInfoPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableServer' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableServer.CurrentPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableServer.POAManagerPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableServer.POAPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableServer.portable' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.PortableServer.ServantLocatorPackage' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.SendingContext' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.omg.stub.java.rmi' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.w3c.dom' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.w3c.dom.bootstrap' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.w3c.dom.events' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.w3c.dom.ls' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.xml.sax' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.xml.sax.ext' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.xml.sax.helpers' version='0.0.0'/>
+ </provides>
+ <touchpoint id='native' version='1.0.0'/>
+ </unit>
+ <unit id='org.eclipse.equinox.prov.engine' version='0.1.0.200709241631'>
+ <properties size='3'>
+ <property name='equinox.p2.update.from' value='org.eclipse.equinox.prov.engine'/>
+ <property name='equinox.p2.update.range' value='0.0.0'/>
+ <property name='equinox.p2.name' value='Engine Plug-in (Incubation)'/>
</properties>
- <artifacts>
- <org.eclipse.equinox.internal.p2.metadata.ArtifactKey>
- <namespace>eclipse</namespace>
- <id>org.eclipse.equinox.prov.engine</id>
- <classifier>plugin</classifier>
- <version>0.1.0.200709241631</version>
- </org.eclipse.equinox.internal.p2.metadata.ArtifactKey>
+ <provides size='6'>
+ <provided namespace='org.eclipse.equinox.p2.iunamespace' name='org.eclipse.equinox.prov.engine' version='0.1.0.200709241631'/>
+ <provided namespace='osgi.packages' name='org.eclipse.equinox.internal.prov.engine' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.eclipse.equinox.prov.engine' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.eclipse.equinox.prov.engine.phases' version='0.0.0'/>
+ <provided namespace='osgi.packages' name='org.eclipse.equinox.prov.installregistry' version='0.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipsetouchpoint.types' name='bundle' version='1.0.0'/>
+ </provides>
+ <requires size='15'>
+ <required namespace='org.eclipse.equinox.p2.iunamespace' name='org.eclipse.equinox.common' range='0.0.0'/>
+ <required namespace='org.eclipse.equinox.p2.iunamespace' name='org.eclipse.equinox.registry' range='0.0.0'/>
+ <required namespace='osgi.packages' name='com.thoughtworks.xstream' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.artifact.repository' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.core.eventbus' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.core.helpers' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.core.location' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.download' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.metadata' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.equinox.prov.query' range='0.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.osgi.service.datalocation' range='1.0.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.osgi.service.resolver' range='1.1.0'/>
+ <required namespace='osgi.packages' name='org.eclipse.osgi.util' range='1.0.0'/>
+ <required namespace='osgi.packages' name='org.osgi.framework' range='1.3.0'/>
+ <required namespace='osgi.packages' name='org.osgi.util.tracker' range='1.3.3'/>
+ </requires>
+ <artifacts size='1'>
+ <artifact namespace='eclipse' classifier='plugin' id='org.eclipse.equinox.prov.engine' version='0.1.0.200709241631'/>
</artifacts>
- <touchpointType>
- <id>eclipse</id>
- <versionObject>
- <major>1</major>
- <minor>0</minor>
- <micro>0</micro>
- <qualifier></qualifier>
- </versionObject>
- <version>1.0.0</version>
- </touchpointType>
- <immutableTouchpointData>
- <instructions>
- <entry>
- <string>manifest</string>
- <string>Bundle-Activator: org.eclipse.equinox.internal.prov.engine.EngineActivator
-Require-Bundle: org.eclipse.equinox.common,org.eclipse.equinox.registry
+ <touchpoint id='eclipse' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Require-Bundle: org.eclipse.equinox.common,org.eclipse.equinox.registry
+Bundle-Activator: org.eclipse.equinox.internal.prov.engine.EngineActivator
Manifest-Version: 1.0
Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1,J2SE-1.4
Import-Package: com.thoughtworks.xstream,org.eclipse.equinox.prov.artifact.repository,org.eclipse.equinox.prov.core.eventbus,org.eclipse.equinox.prov.core.helpers,org.eclipse.equinox.prov.core.location,org.eclipse.equinox.prov.download,org.eclipse.equinox.prov.metadata,org.eclipse.equinox.prov.query,org.eclipse.osgi.service.datalocation;version=&quot;1.0.0&quot;,org.eclipse.osgi.service.resolver;version=&quot;1.1.0&quot;,org.eclipse.osgi.util;version=&quot;1.0.0&quot;,org.osgi.framework;version=&quot;1.3.0&quot;,org.osgi.util.tracker;version=&quot;1.3.3&quot;
Eclipse-LazyStart: true
-Ant-Version: Apache Ant 1.7.0
Bundle-Name: Engine Plug-in (Incubation)
+Ant-Version: Apache Ant 1.7.0
Export-Package: org.eclipse.equinox.internal.prov.engine;x-internal:=true,org.eclipse.equinox.prov.engine,org.eclipse.equinox.prov.engine.phases,org.eclipse.equinox.prov.installregistry
Created-By: 1.6.0_02-b06 (Sun Microsystems Inc.)
Bundle-Version: 0.1.0.200709241631
eclipse.p2.bundle.format: jar
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.equinox.prov.engine;singleton:=true
-</string>
- </entry>
+
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='config.a.jre' version='0.0.0' singleton='false' fragment='true' hostId='a.jre' hostRange='0.0.0'>
+ <provides size='2'>
+ <provided namespace='org.eclipse.equinox.p2.type' name='iu.fragment' version='1.0.0'/>
+ <provided namespace='org.eclipse.equinox.p2.iunamespace' name='config.a.jre' version='0.0.0'/>
+ </provides>
+ <requires size='1'>
+ <required namespace='org.eclipse.equinox.p2.iunamespace' name='a.jre' range='0.0.0'/>
+ </requires>
+ <touchpoint id='native' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='install'>
+
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ <unit id='testdata' version='1.0.0.1' singleton='false'>
+ <properties size='3'>
+ <property name='equinox.p2.update.from' value='testdata'/>
+ <property name='equinox.p2.update.range' value='0.0.0'/>
+ <property name='equinox.p2.name' value='Testdata Plug-in'/>
+ </properties>
+ <provides size='2'>
+ <provided namespace='org.eclipse.equinox.p2.iunamespace' name='testdata' version='1.0.0.1'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipsetouchpoint.types' name='bundle' version='1.0.0'/>
+ </provides>
+ <requires size='1'>
+ <required namespace='osgi.packages' name='org.osgi.framework' range='1.3.0'/>
+ </requires>
+ <artifacts size='1'>
+ <artifact namespace='eclipse' classifier='plugin' id='testdata' version='1.0.0.1'/>
+ </artifacts>
+ <touchpoint id='eclipse' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Manifest-Version: 1.0
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1
+Import-Package: org.osgi.framework;version=&quot;1.3.0&quot;
+Eclipse-LazyStart: true
+Ant-Version: Apache Ant 1.7.0
+Bundle-Name: Testdata Plug-in
+Created-By: 2.3 (IBM Corporation)
+Bundle-Version: 1.0.0.1
+eclipse.p2.bundle.format: jar
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: testdata
+
+ </instruction>
</instructions>
- </immutableTouchpointData>
- <requires>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.common</name>
- <namespace>org.eclipse.equinox.p2.iunamespace</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.registry</name>
- <namespace>org.eclipse.equinox.p2.iunamespace</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>com.thoughtworks.xstream</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.artifact.repository</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.core.eventbus</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.core.helpers</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.core.location</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.download</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.metadata</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.equinox.prov.query</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.osgi.service.datalocation</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <range>1.0.0</range>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.osgi.service.resolver</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <range>1.1.0</range>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.eclipse.osgi.util</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <range>1.0.0</range>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.osgi.framework</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <range>1.3.0</range>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
- <org.eclipse.equinox.p2.metadata.RequiredCapability>
- <multiple>false</multiple>
- <name>org.osgi.util.tracker</name>
- <namespace>osgi.packages</namespace>
- <optional>false</optional>
- <range>1.3.3</range>
- <selectors/>
- </org.eclipse.equinox.p2.metadata.RequiredCapability>
+ </touchpointData>
+ </unit>
+ <unit id='testdata' version='1.0.0.2' singleton='false'>
+ <properties size='3'>
+ <property name='equinox.p2.update.from' value='testdata'/>
+ <property name='equinox.p2.update.range' value='0.0.0'/>
+ <property name='equinox.p2.name' value='Testdata Plug-in'/>
+ </properties>
+ <provides size='2'>
+ <provided namespace='org.eclipse.equinox.p2.iunamespace' name='testdata' version='1.0.0.2'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipsetouchpoint.types' name='bundle' version='1.0.0'/>
+ </provides>
+ <requires size='1'>
+ <required namespace='osgi.packages' name='org.osgi.framework' range='1.3.0'/>
</requires>
- <applicabilityFilter></applicabilityFilter>
- <providedCapabilities>
- <org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <namespace>osgi.packages</namespace>
- <name>org.eclipse.equinox.internal.prov.engine</name>
- </org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <namespace>osgi.packages</namespace>
- <name>org.eclipse.equinox.prov.engine</name>
- </org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <namespace>osgi.packages</namespace>
- <name>org.eclipse.equinox.prov.engine.phases</name>
- </org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <namespace>osgi.packages</namespace>
- <name>org.eclipse.equinox.prov.installregistry</name>
- </org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <org.eclipse.equinox.p2.metadata.ProvidedCapability>
- <namespace>org.eclipse.equinox.p2.eclipsetouchpoint.types</namespace>
- <name>bundle</name>
- <version>1.0.0</version>
- </org.eclipse.equinox.p2.metadata.ProvidedCapability>
- </providedCapabilities>
- </org.eclipse.equinox.p2.metadata.InstallableUnit>
+ <artifacts size='1'>
+ <artifact namespace='eclipse' classifier='plugin' id='testdata' version='1.0.0.2'/>
+ </artifacts>
+ <touchpoint id='eclipse' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Manifest-Version: 1.0
+Bundle-RequiredExecutionEnvironment: CDC-1.1/Foundation-1.1
+Import-Package: org.osgi.framework;version=&quot;1.3.0&quot;
+Eclipse-LazyStart: true
+Ant-Version: Apache Ant 1.7.0
+Bundle-Name: Testdata Plug-in
+Created-By: 2.3 (IBM Corporation)
+Bundle-Version: 1.0.0.2
+eclipse.p2.bundle.format: jar
+Bundle-ManifestVersion: 2
+Bundle-SymbolicName: testdata
+
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
</units>
- <name>file:D:\workspaces\prov.selfhost\org.eclipse.equinox.p2.tests\testData\enginerepo - metadata</name>
- <type>org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository</type>
- <version>1</version>
- <description></description>
- <provider></provider>
- <properties/>
-</org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository> \ No newline at end of file
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.1.jar b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.1.jar
new file mode 100644
index 000000000..49e7f90a2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.1.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.2.jar b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.2.jar
new file mode 100644
index 000000000..3515b0f46
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/enginerepo/plugins/testdata_1.0.0.2.jar
Binary files differ

Back to the top