Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormzhu2011-05-06 06:43:33 +0000
committermzhu2011-05-06 06:43:33 +0000
commit1f1be55557f4b412a79450b245c4ac6aaf0be3ad (patch)
tree9b30ee5e322173dca571bf4858990218431d88b3 /bundles
parent7a4b6083659d0ecd17473acf3229b5581b096807 (diff)
downloadrt.equinox.p2-1f1be55557f4b412a79450b245c4ac6aaf0be3ad.tar.gz
rt.equinox.p2-1f1be55557f4b412a79450b245c4ac6aaf0be3ad.tar.xz
rt.equinox.p2-1f1be55557f4b412a79450b245c4ac6aaf0be3ad.zip
release the fix of bugzilla 343921
Diffstat (limited to 'bundles')
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF2
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java118
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java118
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/importexport/incompatible.p2f17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/importexport/repo1/content.xml47
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/importexport/test.p2f17
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/importexport/unknownformat.p2f138
-rw-r--r--bundles/org.eclipse.equinox.p2.testserver/src/org/eclipse/equinox/p2/testserver/Activator.java1
-rw-r--r--bundles/org.eclipse.equinox.p2.testserver/webfiles/importexport/content.xml47
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java7
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/VersionInCompatibleException.java24
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java6
-rwxr-xr-xbundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties2
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java6
-rw-r--r--bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java32
17 files changed, 580 insertions, 20 deletions
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 0b1c54ed8..b04c990d9 100644
--- a/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.tests/META-INF/MANIFEST.MF
@@ -70,6 +70,8 @@ Import-Package: javax.xml.parsers,
org.eclipse.equinox.internal.p2.director,
org.eclipse.equinox.internal.p2.director.app,
org.eclipse.equinox.internal.p2.extensionlocation,
+ org.eclipse.equinox.internal.p2.importexport;version="1.3.0",
+ org.eclipse.equinox.internal.p2.importexport.internal,
org.eclipse.equinox.internal.p2.jarprocessor,
org.eclipse.equinox.internal.p2.jarprocessor.verifier,
org.eclipse.equinox.internal.p2.metadata,
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java
index 861b1c7a6..220b40c93 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/AutomatedTests.java
@@ -52,6 +52,7 @@ public class AutomatedTests extends TestCase {
suite.addTest(org.eclipse.equinox.p2.tests.reconciler.dropins.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.updatechecker.AllTests.suite());
suite.addTest(org.eclipse.equinox.p2.tests.full.AllTests.suite());
+ suite.addTest(org.eclipse.equinox.p2.tests.importexport.AllTests.suite());
return suite;
}
}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java
new file mode 100644
index 000000000..0727874d7
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/AllTests.java
@@ -0,0 +1,17 @@
+package org.eclipse.equinox.p2.tests.importexport;
+
+import junit.framework.*;
+
+/**
+ * Performs all automated importexport tests.
+ */
+public class AllTests extends TestCase {
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(AllTests.class.getName());
+ suite.addTestSuite(ImportExportTests.class);
+ suite.addTestSuite(ImportExportRemoteTests.class);
+ return suite;
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java
new file mode 100644
index 000000000..616116f97
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportRemoteTests.java
@@ -0,0 +1,118 @@
+package org.eclipse.equinox.p2.tests.importexport;
+
+import java.io.*;
+import java.net.*;
+import java.util.List;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.importexport.P2ImportExport;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.repository.IRepositoryManager;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+import org.eclipse.equinox.p2.tests.TestActivator;
+import org.eclipse.equinox.p2.tests.metadata.repository.ServerBasedTestCase;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class ImportExportRemoteTests extends ServerBasedTestCase {
+
+ private P2ImportExport importexportService;
+
+ private URI getTestRepository() throws URISyntaxException {
+ return new URI(getBaseURL() + "/importexport/");
+ }
+
+ @Override
+ public void setUp() throws Exception {
+ super.setUp();
+ ServiceTracker<P2ImportExport, P2ImportExport> tracker = new ServiceTracker<P2ImportExport, P2ImportExport>(TestActivator.getContext(), P2ImportExport.class, null);
+ tracker.open();
+ importexportService = tracker.getService();
+ assertNotNull("Fail to get ImportExport service", importexportService);
+ tracker.close();
+ }
+
+ @Override
+ public void tearDown() throws Exception {
+ super.tearDown();
+ importexportService = null;
+ IMetadataRepositoryManager repoMan = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
+ URI[] urls = repoMan.getKnownRepositories(IRepositoryManager.REPOSITORIES_ALL);
+ for (int i = 0; i < urls.length; i++) {
+ repoMan.removeRepository(urls[i]);
+ }
+ }
+
+ public void testExportFeaturesFromRemoteRepository() throws URISyntaxException, IOException, ProvisionException, OperationCanceledException {
+ File testFile = File.createTempFile("test", "p2f");
+ URI uri = getTestRepository();
+ try {
+ IMetadataRepositoryManager metaManager = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
+ IMetadataRepository repo = metaManager.loadRepository(uri, null);
+ assertNotNull("Fail to load remote repo", repo);
+ IInstallableUnit iu = AbstractProvisioningTest.createIU("A", Version.create("1.0.0"));
+ OutputStream output = new FileOutputStream(testFile);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, null);
+ assertTrue("Not expected return result.", status.isOK());
+ output.close();
+ InputStream input = new FileInputStream(testFile);
+ List<IUDetail> ius = importexportService.importP2F(input);
+ assertEquals("Exported the number of features is not expected.", 1, ius.size());
+ assertTrue("Exported feature is not expected.", iu.equals(ius.get(0).getIU()));
+ assertEquals("Exported the number of referred repositories is not expected.", 1, ius.get(0).getReferencedRepositories().size());
+ assertEquals("Exported referred repository is not expected.", uri, ius.get(0).getReferencedRepositories().get(0));
+ input.close();
+ } finally {
+ testFile.delete();
+ }
+ }
+
+ protected File getTestData(String message, String entry) {
+ if (entry == null)
+ fail(message + " entry is null.");
+ URL base = TestActivator.getContext().getBundle().getEntry(entry);
+ if (base == null)
+ fail(message + " entry not found in bundle: " + entry);
+ try {
+ String osPath = new Path(FileLocator.toFileURL(base).getPath()).toOSString();
+ File result = new File(osPath);
+ if (!result.getCanonicalPath().equals(result.getPath()))
+ fail(message + " result path: " + result.getPath() + " does not match canonical path: " + result.getCanonicalFile().getPath());
+ return result;
+ } catch (IOException e) {
+ fail(message);
+ }
+ // avoid compile error... should never reach this code
+ return null;
+ }
+
+ public void testExportFeaturesFromBothRemoteRepositoryAndLocalRepository() throws URISyntaxException, IOException, ProvisionException, OperationCanceledException {
+ File testFile = File.createTempFile("test", "p2f");
+ URI uri = getTestRepository();
+ try {
+ IMetadataRepositoryManager metaManager = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
+ File localRepoFile = getTestData("Error load data", "testData/importexport/repo1");
+ IMetadataRepository localRepo = metaManager.loadRepository(localRepoFile.toURI(), null);
+ assertNotNull("Fail to load local repo", localRepo);
+ IMetadataRepository repo = metaManager.loadRepository(uri, null);
+ assertNotNull("Fail to load remote repo", repo);
+ IInstallableUnit iu = AbstractProvisioningTest.createIU("A", Version.create("1.0.0"));
+ OutputStream output = new FileOutputStream(testFile);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, null);
+ assertTrue("Not expected return result.", status.isOK());
+ output.close();
+ InputStream input = new FileInputStream(testFile);
+ List<IUDetail> ius = importexportService.importP2F(input);
+ assertEquals("Exported the number of features is not expected.", 1, ius.size());
+ assertTrue("Exported feature is not expected.", iu.equals(ius.get(0).getIU()));
+ assertEquals("Exported the number of referred repositories is not expected.", 1, ius.get(0).getReferencedRepositories().size());
+ assertEquals("Exported referred repository is not expected.", uri, ius.get(0).getReferencedRepositories().get(0));
+ input.close();
+ } finally {
+ testFile.delete();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java
new file mode 100644
index 000000000..dbdebe4be
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/importexport/ImportExportTests.java
@@ -0,0 +1,118 @@
+package org.eclipse.equinox.p2.tests.importexport;
+
+import java.io.*;
+import java.util.ArrayList;
+import java.util.List;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.OperationCanceledException;
+import org.eclipse.equinox.internal.p2.importexport.*;
+import org.eclipse.equinox.internal.p2.importexport.internal.ImportExportImpl;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.metadata.IInstallableUnit;
+import org.eclipse.equinox.p2.metadata.Version;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+import org.eclipse.equinox.p2.tests.TestActivator;
+import org.osgi.util.tracker.ServiceTracker;
+
+public class ImportExportTests extends AbstractProvisioningTest {
+
+ private P2ImportExport importexportService;
+
+ private List<IStatus> getChildren(IStatus s) {
+ List<IStatus> rt = new ArrayList<IStatus>();
+ if (s.isMultiStatus()) {
+ for (IStatus child : s.getChildren()) {
+ rt.addAll(getChildren(child));
+ }
+ }
+ rt.add(s);
+ return rt;
+ }
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ ServiceTracker<P2ImportExport, P2ImportExport> tracker = new ServiceTracker<P2ImportExport, P2ImportExport>(TestActivator.getContext(), P2ImportExport.class, null);
+ tracker.open();
+ importexportService = tracker.getService();
+ assertNotNull("Fail to get ImportExport service", importexportService);
+ tracker.close();
+ }
+
+ @Override
+ protected void tearDown() throws Exception {
+ super.tearDown();
+ importexportService = null;
+ }
+
+ public void testLoadP2f() throws IOException {
+ File p2fFile = getTestData("Error load test file.", "testData/importexport/test.p2f");
+ InputStream input = new FileInputStream(p2fFile);
+ try {
+ List<IUDetail> iuDetails = importexportService.importP2F(input);
+ assertTrue("Should load two features from the p2f file.", iuDetails.size() == 2);
+ int counter = 0;
+ for (IUDetail iu : iuDetails) {
+ if ("org.polarion.eclipse.team.svn.connector.feature.group".equals(iu.getIU().getId())) {
+ counter++;
+ assertTrue("Should have two referred repository.", iu.getReferencedRepositories().size() == 2);
+ } else if ("org.polarion.eclipse.team.svn.connector.svnkit16.feature.group".equals(iu.getIU().getId())) {
+ counter++;
+ assertTrue("Should have one referred repository", iu.getReferencedRepositories().size() == 1);
+ }
+ }
+ assertEquals("Load unexpected content.", 2, counter);
+ } finally {
+ input.close();
+ }
+ }
+
+ public void testLoadUnknownP2f() throws IOException {
+ File p2fFile = getTestData("Error load test file.", "testData/importexport/unknownformat.p2f");
+ InputStream input = new FileInputStream(p2fFile);
+ try {
+ List<IUDetail> iuDetails = importexportService.importP2F(input);
+ assertEquals("Should not load any detail.", 0, iuDetails.size());
+ } finally {
+ input.close();
+ }
+ }
+
+ public void testIncompatibleP2f() throws IOException {
+ File p2fFile = getTestData("Error load test file.", "testData/importexport/incompatible.p2f");
+ InputStream input = new FileInputStream(p2fFile);
+ try {
+ importexportService.importP2F(input);
+ assertTrue("Didn't complain the given file is not supported by current version.", false);
+ } catch (VersionInCompatibleException e) {
+ // expected
+ } finally {
+ input.close();
+ }
+ }
+
+ public void testExportFeaturesInstalledFromLocal() throws ProvisionException, OperationCanceledException, IOException {
+ File testFile = File.createTempFile("test", "p2f");
+ try {
+ IMetadataRepositoryManager metaManager = (IMetadataRepositoryManager) getAgent().getService(IMetadataRepositoryManager.SERVICE_NAME);
+ File localRepoFile = getTestData("Error load data", "testData/importexport/repo1");
+ IMetadataRepository repo = metaManager.loadRepository(localRepoFile.toURI(), null);
+ assertNotNull("Fail to load local repo", repo);
+ IInstallableUnit iu = createIU("A", Version.create("1.0.0"));
+ OutputStream output = new FileOutputStream(testFile);
+ IStatus status = importexportService.exportP2F(output, new IInstallableUnit[] {iu}, null);
+ assertFalse("Not expected return result.", status.isOK());
+ assertTrue("Should be a multiple status", status.isMultiStatus());
+ boolean hasFeaturesIgnored = false;
+ for (IStatus s : getChildren(status))
+ if (s.getCode() == ImportExportImpl.IGNORE_LOCAL_REPOSITORY)
+ hasFeaturesIgnored = true;
+ assertTrue("Should have features ignored due to they're installed from local repository.", hasFeaturesIgnored);
+ output.close();
+ } finally {
+ testFile.delete();
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/importexport/incompatible.p2f b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/incompatible.p2f
new file mode 100644
index 000000000..4cc25fbb8
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/incompatible.p2f
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?p2f version='10.0.0'?>
+<p2f>
+ <ius size='2'>
+ <iu id='org.polarion.eclipse.team.svn.connector.feature.group' name='Subversive SVN Connectors' version='2.2.2.I20110124-1700'>
+ <repositories size='2'>
+ <repository location='http://community.polarion.com/projects/subversive/download/eclipse/2.0/helios-site/'/>
+ <repository location='http://www.test.com/site/'/>
+ </repositories>
+ </iu>
+ <iu id='org.polarion.eclipse.team.svn.connector.svnkit16.feature.group' name='SVNKit 1.3.5 Implementation (Optional)' version='2.2.2.I20110124-1700'>
+ <repositories size='1'>
+ <repository location='http://community.polarion.com/projects/subversive/download/eclipse/2.0/helios-site/'/>
+ </repositories>
+ </iu>
+ </ius>
+</p2f>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/importexport/repo1/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/repo1/content.xml
new file mode 100644
index 000000000..03cc70593
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/repo1/content.xml
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+
+<repository name='Installer Plan' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
+
+<properties size='1'>
+
+<property name='p2.timestamp' value='1239212031654'/>
+
+</properties>
+
+<units size='4'>
+
+<unit id='A' version='1.0.0'>
+
+<properties>
+<property name='org.eclipse.equinox.p2.type.group' value='true'/>
+
+</properties>
+
+<provides size='1'>
+<provided namespace='org.eclipse.equinox.p2.iu' name='A' version='1.0.0'/>
+</provides>
+
+<touchpoint id='null' version='0.0.0'/>
+
+<touchpointData size='1'/>
+
+</unit>
+
+<unit id='B' version='1.0.0' singleton='false'>
+
+<properties>
+<property name='org.eclipse.equinox.p2.type.group' value='true'/>
+</properties>
+
+<provides size='2'>
+<provided namespace='org.eclipse.equinox.p2.iu' name='B' version='1.0.0'/>
+<provided namespace='eclipse.touchpoint' name='bundle' version='1.0.0'/>
+</provides>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+<touchpointData size='1'/>
+
+</unit>
+</units>
+
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/importexport/test.p2f b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/test.p2f
new file mode 100644
index 000000000..2a63f780a
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/test.p2f
@@ -0,0 +1,17 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?p2f version='1.0.0'?>
+<p2f version='1.0.0'>
+ <ius size='2'>
+ <iu id='org.polarion.eclipse.team.svn.connector.feature.group' name='Subversive SVN Connectors' version='2.2.2.I20110124-1700'>
+ <repositories size='2'>
+ <repository location='http://community.polarion.com/projects/subversive/download/eclipse/2.0/helios-site/'/>
+ <repository location='http://www.test.com/site/'/>
+ </repositories>
+ </iu>
+ <iu id='org.polarion.eclipse.team.svn.connector.svnkit16.feature.group' name='SVNKit 1.3.5 Implementation (Optional)' version='2.2.2.I20110124-1700'>
+ <repositories size='1'>
+ <repository location='http://community.polarion.com/projects/subversive/download/eclipse/2.0/helios-site/'/>
+ </repositories>
+ </iu>
+ </ius>
+</p2f>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/importexport/unknownformat.p2f b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/unknownformat.p2f
new file mode 100644
index 000000000..9ae98bf32
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/importexport/unknownformat.p2f
@@ -0,0 +1,138 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<p2f>
+ <units>
+ <unit id='hgeclipse.feature.group' version='1.5.0.201001202311' singleton='false'>
+ <update id='hgeclipse.feature.group' range='[0.0.0,1.5.0.201001202311)' severity='0'/>
+ <properties size='5'>
+ <property name='org.eclipse.equinox.p2.name' value='HgEclipse'/>
+ <property name='org.eclipse.equinox.p2.description' value='Mercurial plugin for Eclipse IDE'/>
+ <property name='org.eclipse.equinox.p2.description.url' value='http://www.example.com/description'/>
+ <property name='org.eclipse.equinox.p2.provider' value='HgEclipse'/>
+ <property name='org.eclipse.equinox.p2.type.group' value='true'/>
+ </properties>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='hgeclipse.feature.group' version='1.5.0.201001202311'/>
+ </provides>
+ <requires size='2'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='com.vectrace.MercurialEclipse' range='[1.5.0.201001202311,1.5.0.201001202311]'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='hgeclipse.feature.jar' range='[1.5.0.201001202311,1.5.0.201001202311]'>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ </required>
+ </requires>
+ <touchpoint id='null' version='0.0.0'/>
+ <licenses size='1'>
+ <license uri='http://www.example.com/license' url='http://www.example.com/license'>
+ Eclipse Public License - v 1.0&#xA;&#xA;THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE, REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT&apos;S ACCEPTANCE OF THIS AGREEMENT.&#xA;&#xA;1. DEFINITIONS&#xA;&#xA;&quot;Contribution&quot; means:&#xA;&#xA;a) in the case of the initial Contributor, the initial code and documentation distributed under this Agreement, and&#xA;&#xA;b) in the case of each subsequent Contributor:&#xA;&#xA;i) changes to the Program, and&#xA;&#xA;ii) additions to the Program;&#xA;&#xA;where such changes and/or additions to the Program originate from and are distributed by that particular Contributor. A Contribution &apos;originates&apos; from a Contributor if it was added to the Program by such Contributor itself or anyone acting on such Contributor&apos;s behalf. Contributions do not include additions to the Program which: (i) are separate modules of software distributed in conjunction with the Program under their own license agreement, and (ii) are not derivative works of the Program.&#xA;&#xA;&quot;Contributor&quot; means any person or entity that distributes the Program.&#xA;&#xA;&quot;Licensed Patents&quot; mean patent claims licensable by a Contributor which are necessarily infringed by the use or sale of its Contribution alone or when combined with the Program.&#xA;&#xA;&quot;Program&quot; means the Contributions distributed in accordance with this Agreement.&#xA;&#xA;&quot;Recipient&quot; means anyone who receives the Program under this Agreement, including all Contributors.&#xA;&#xA;2. GRANT OF RIGHTS&#xA;&#xA;a) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, distribute and sublicense the Contribution of such Contributor, if any, and such derivative works, in source code and object code form.&#xA;&#xA;b) Subject to the terms of this Agreement, each Contributor hereby grants Recipient a non-exclusive, worldwide, royalty-free patent license under Licensed Patents to make, use, sell, offer to sell, import and otherwise transfer the Contribution of such Contributor, if any, in source code and object code form. This patent license shall apply to the combination of the Contribution and the Program if, at the time the Contribution is added by the Contributor, such addition of the Contribution causes such combination to be covered by the Licensed Patents. The patent license shall not apply to any other combinations which include the Contribution. No hardware per se is licensed hereunder.&#xA;&#xA;c) Recipient understands that although each Contributor grants the licenses to its Contributions set forth herein, no assurances are provided by any Contributor that the Program does not infringe the patent or other intellectual property rights of any other entity. Each Contributor disclaims any liability to Recipient for claims brought by any other entity based on infringement of intellectual property rights or otherwise. As a condition to exercising the rights and licenses granted hereunder, each Recipient hereby assumes sole responsibility to secure any other intellectual property rights needed, if any. For example, if a third party patent license is required to allow Recipient to distribute the Program, it is Recipient&apos;s responsibility to acquire that license before distributing the Program.&#xA;&#xA;d) Each Contributor represents that to its knowledge it has sufficient copyright rights in its Contribution, if any, to grant the copyright license set forth in this Agreement.&#xA;&#xA;3. REQUIREMENTS&#xA;&#xA;A Contributor may choose to distribute the Program in object code form under its own license agreement, provided that:&#xA;&#xA;a) it complies with the terms and conditions of this Agreement; and&#xA;&#xA;b) its license agreement:&#xA;&#xA;i) effectively disclaims on behalf of all Contributors all warranties and conditions, express and implied, including warranties or conditions of title and non-infringement, and implied warranties or conditions of merchantability and fitness for a particular purpose;&#xA;&#xA;ii) effectively excludes on behalf of all Contributors all liability for damages, including direct, indirect, special, incidental and consequential damages, such as lost profits;&#xA;&#xA;iii) states that any provisions which differ from this Agreement are offered by that Contributor alone and not by any other party; and&#xA;&#xA;iv) states that source code for the Program is available from such Contributor, and informs licensees how to obtain it in a reasonable manner on or through a medium customarily used for software exchange.&#xA;&#xA;When the Program is made available in source code form:&#xA;&#xA;a) it must be made available under this Agreement; and&#xA;&#xA;b) a copy of this Agreement must be included with each copy of the Program.&#xA;&#xA;Contributors may not remove or alter any copyright notices contained within the Program.&#xA;&#xA;Each Contributor must identify itself as the originator of its Contribution, if any, in a manner that reasonably allows subsequent Recipients to identify the originator of the Contribution.&#xA;&#xA;4. COMMERCIAL DISTRIBUTION&#xA;&#xA;Commercial distributors of software may accept certain responsibilities with respect to end users, business partners and the like. While this license is intended to facilitate the commercial use of the Program, the Contributor who includes the Program in a commercial product offering should do so in a manner which does not create potential liability for other Contributors. Therefore, if a Contributor includes the Program in a commercial product offering, such Contributor (&quot;Commercial Contributor&quot;) hereby agrees to defend and indemnify every other Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other legal actions brought by a third party against the Indemnified Contributor to the extent caused by the acts or omissions of such Commercial Contributor in connection with its distribution of the Program in a commercial product offering. The obligations in this section do not apply to any claims or Losses relating to any actual or alleged intellectual property infringement. In order to qualify, an Indemnified Contributor must: a) promptly notify the Commercial Contributor in writing of such claim, and b) allow the Commercial Contributor to control, and cooperate with the Commercial Contributor in, the defense and any related settlement negotiations. The Indemnified Contributor may participate in any such claim at its own expense.&#xA;&#xA;For example, a Contributor might include the Program in a commercial product offering, Product X. That Contributor is then a Commercial Contributor. If that Commercial Contributor then makes performance claims, or offers warranties related to Product X, those performance claims and warranties are such Commercial Contributor&apos;s responsibility alone. Under this section, the Commercial Contributor would have to defend claims against the other Contributors related to those performance claims and warranties, and if a court requires any other Contributor to pay any damages as a result, the Commercial Contributor must pay those damages.&#xA;&#xA;5. NO WARRANTY&#xA;&#xA;EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely responsible for determining the appropriateness of using and distributing the Program and assumes all risks associated with its exercise of rights under this Agreement , including but not limited to the risks and costs of program errors, compliance with applicable laws, damage to or loss of data, programs or equipment, and unavailability or interruption of operations.&#xA;&#xA;6. DISCLAIMER OF LIABILITY&#xA;&#xA;EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.&#xA;&#xA;7. GENERAL&#xA;&#xA;If any provision of this Agreement is invalid or unenforceable under applicable law, it shall not affect the validity or enforceability of the remainder of the terms of this Agreement, and without further action by the parties hereto, such provision shall be reformed to the minimum extent necessary to make such provision valid and enforceable.&#xA;&#xA;If Recipient institutes patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Program itself (excluding combinations of the Program with other software or hardware) infringes such Recipient&apos;s patent(s), then such Recipient&apos;s rights granted under Section 2(b) shall terminate as of the date such litigation is filed.&#xA;&#xA;All Recipient&apos;s rights under this Agreement shall terminate if it fails to comply with any of the material terms or conditions of this Agreement and does not cure such failure in a reasonable period of time after becoming aware of such noncompliance. If all Recipient&apos;s rights under this Agreement terminate, Recipient agrees to cease use and distribution of the Program as soon as reasonably practicable. However, Recipient&apos;s obligations under this Agreement and any licenses granted by Recipient relating to the Program shall continue and survive.&#xA;&#xA;Everyone is permitted to copy and distribute copies of this Agreement, but in order to avoid inconsistency the Agreement is copyrighted and may only be modified in the following manner. The Agreement Steward reserves the right to publish new versions (including revisions) of this Agreement from time to time. No one other than the Agreement Steward has the right to modify this Agreement. The Eclipse Foundation is the initial Agreement Steward. The Eclipse Foundation may assign the responsibility to serve as the Agreement Steward to a suitable separate entity. Each new version of the Agreement will be given a distinguishing version number. The Program (including Contributions) may always be distributed subject to the version of the Agreement under which it was received. In addition, after a new version of the Agreement is published, Contributor may elect to distribute the Program (including its Contributions) under the new version. Except as expressly stated in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to the intellectual property of any Contributor under this Agreement, whether expressly, by implication, estoppel or otherwise. All rights in the Program not expressly granted under this Agreement are reserved.&#xA;&#xA;This Agreement is governed by the laws of the State of New York and the intellectual property laws of the United States of America. No party to this Agreement will bring a legal action under this Agreement more than one year after the cause of action arose. Each party waives its rights to a jury trial in any resulting litigation.
+ </license>
+ </licenses>
+ <copyright uri='http://www.example.com/copyright' url='http://www.example.com/copyright'>
+ Copyright (c)&#xA;All rights reserved. This program and the accompanying materials&#xA;are made available under the terms of the Eclipse Public License&#xA;v1.0&#xA;which accompanies this distribution, and is available at&#xA;http://www.eclipse.org/legal/epl-v10.html
+ </copyright>
+ </unit>
+ <unit id='org.eclipse.linuxtools.lttng.feature.group' version='0.2.0.201003020944' singleton='false'>
+ <update id='org.eclipse.linuxtools.lttng.feature.group' range='[0.0.0,0.2.0.201003020944)' severity='0'/>
+ <properties size='9'>
+ <property name='org.eclipse.equinox.p2.name' value='%featureName'/>
+ <property name='org.eclipse.equinox.p2.description' value='%description'/>
+ <property name='org.eclipse.equinox.p2.provider' value='%featureProvider'/>
+ <property name='org.eclipse.equinox.p2.type.group' value='true'/>
+ <property name='df_LT.featureName' value='Linux Tracing Toolkit Integration (LTTng) (Incubation)'/>
+ <property name='df_LT.copyright' value='Copyright 2009 Ericsson'/>
+ <property name='df_LT.featureProvider' value='Eclipse'/>
+ <property name='df_LT.description' value='Plugins to integrate LTTng tools into the workbench.'/>
+ <property name='df_LT.license' value='ECLIPSE FOUNDATION SOFTWARE USER AGREEMENT&#xA;March 17, 2005&#xA;&#xA;Usage Of Content&#xA;&#xA;THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR&#xA;OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY &quot;CONTENT&quot;).&#xA;USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS&#xA;AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR&#xA;NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU&#xA;AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT&#xA;AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS&#xA;OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE&#xA;TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS&#xA;OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED&#xA;BELOW, THEN YOU MAY NOT USE THE CONTENT.&#xA;&#xA;Applicable Licenses&#xA;&#xA;Unless otherwise indicated, all Content made available by the Eclipse Foundation&#xA;is provided to you under the terms and conditions of the Eclipse Public&#xA;License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is provided with this&#xA;Content and is also available at http://www.eclipse.org/legal/epl-v10.html.&#xA;For purposes of the EPL, &quot;Program&quot; will mean the Content.&#xA;&#xA;Content includes, but is not limited to, source code, object code,&#xA;documentation and other files maintained in the Eclipse.org CVS&#xA;repository (&quot;Repository&quot;) in CVS modules (&quot;Modules&quot;) and made available&#xA;as downloadable archives (&quot;Downloads&quot;).&#xA;&#xA;- Content may be structured and packaged into modules to facilitate delivering,&#xA;extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;),&#xA;plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).&#xA;- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)&#xA;in a directory named &quot;plugins&quot;.&#xA;- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.&#xA;Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;.&#xA;Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version&#xA;numbers of the Plug-ins and/or Fragments associated with that Feature.&#xA;- Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files&#xA;named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.&#xA;&#xA;Features may also include other Features (&quot;Included Features&quot;). Files named&#xA;&quot;feature.xml&quot; may contain a list of the names and version numbers of&#xA;Included Features.&#xA;&#xA;The terms and conditions governing Plug-ins and Fragments should be&#xA;contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and&#xA;conditions governing Features and Included Features should be contained&#xA;in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature&#xA;Licenses may be located in any directory of a Download or Module&#xA;including, but not limited to the following locations:&#xA;&#xA;- The top-level (root) directory&#xA;- Plug-in and Fragment directories&#xA;- Inside Plug-ins and Fragments packaged as JARs&#xA;- Sub-directories of the directory named &quot;src&quot; of certain Plug-ins&#xA;- Feature directories&#xA;&#xA;Note: if a Feature made available by the Eclipse Foundation is installed using the&#xA;Eclipse Update Manager, you must agree to a license (&quot;Feature Update&#xA;License&quot;) during the installation process. If the Feature contains&#xA;Included Features, the Feature Update License should either provide you&#xA;with the terms and conditions governing the Included Features or inform&#xA;you where you can locate them. Feature Update Licenses may be found in&#xA;the &quot;license&quot; property of files named &quot;feature.properties&quot;. Such Abouts,&#xA;Feature Licenses and Feature Update Licenses contain the terms and&#xA;conditions (or references to such terms and conditions) that govern your&#xA;use of the associated Content in that directory.&#xA;&#xA;THE ABOUTS, FEATURE LICENSES AND FEATURE UPDATE LICENSES MAY REFER&#xA;TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.&#xA;SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):&#xA;&#xA;- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)&#xA;- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)&#xA;- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)&#xA;- IBM Public License 1.0 (available at http://oss.software.ibm.com/developerworks/opensource/license10.html)&#xA;- Metro Link Public License 1.00 (available at http://www.opengroup.org/openmotif/supporters/metrolink/license.html)&#xA;- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)&#xA;&#xA;IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR&#xA;TO USE OF THE CONTENT. If no About, Feature License or Feature Update License&#xA;is provided, please contact the Eclipse Foundation to determine what terms and conditions&#xA;govern that particular Content.&#xA;&#xA;Cryptography&#xA;&#xA;Content may contain encryption software. The country in which you are&#xA;currently may have restrictions on the import, possession, and use,&#xA;and/or re-export to another country, of encryption software. BEFORE&#xA;using any encryption software, please check the country&apos;s laws,&#xA;regulations and policies concerning the import, possession, or use,&#xA;and re-export of encryption software, to see if this is permitted.&#xA;&#xA;Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.'/>
+ </properties>
+ <provides size='2'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng.feature.group' version='0.2.0.201003020944'/>
+ <provided namespace='org.eclipse.equinox.p2.localization' name='df_LT' version='1.0.0'/>
+ </provides>
+ <requires size='14'>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.core.runtime' range='0.0.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.tmf' range='0.2.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.ui' range='0.0.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.tmf.ui' range='0.2.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng' range='0.2.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng.jni' range='0.2.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.ui.ide' range='0.0.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.core.resources' range='0.0.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.core.filesystem' range='0.0.0'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng' range='[0.2.0.201003020944,0.2.0.201003020944]'>
+ <filter>
+ (osgi.os=linux)
+ </filter>
+ </required>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng.ui' range='[0.2.0.201003020944,0.2.0.201003020944]'>
+ <filter>
+ (osgi.os=linux)
+ </filter>
+ </required>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng.help' range='[0.2.0.201003020944,0.2.0.201003020944]'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng.jni' range='[0.2.0.201003020944,0.2.0.201003020944]'/>
+ <required namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.linuxtools.lttng.feature.jar' range='[0.2.0.201003020944,0.2.0.201003020944]'>
+ <filter>
+ (org.eclipse.update.install.features=true)
+ </filter>
+ </required>
+ </requires>
+ <filter>
+ (osgi.os=linux)
+ </filter>
+ <touchpoint id='null' version='0.0.0'/>
+ <licenses size='1'>
+ <license uri='%25licenseURL' url='%25licenseURL'>
+ %license
+ </license>
+ </licenses>
+ <copyright>
+ %copyright
+ </copyright>
+ </unit>
+ <unit id='org.eclipse.equinox.p2.replication' version='1.2.0.201004151326'>
+ <update id='org.eclipse.equinox.p2.replication' range='[0.0.0,1.2.0.201004151326)' severity='0'/>
+ <properties size='3'>
+ <property name='org.eclipse.equinox.p2.name' value='Eclipse P2 Installation Replication'/>
+ <property name='org.eclipse.equinox.p2.provider' value='kane.zhu@windriver.com'/>
+ <property name='org.eclipse.equinox.p2.bundle.localization' value='plugin'/>
+ </properties>
+ <provides size='3'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='org.eclipse.equinox.p2.replication' version='1.2.0.201004151326'/>
+ <provided namespace='osgi.bundle' name='org.eclipse.equinox.p2.replication' version='1.2.0.201004151326'/>
+ <provided namespace='org.eclipse.equinox.p2.eclipse.type' name='bundle' version='1.0.0'/>
+ </provides>
+ <requires size='14'>
+ <required namespace='osgi.bundle' name='org.eclipse.ui' range='0.0.0'/>
+ <required namespace='osgi.bundle' name='org.eclipse.core.runtime' range='0.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.internal.p2.metadata.repository.io' range='0.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.internal.p2.persistence' range='0.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.internal.provisional.p2.director' range='0.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.core' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.engine' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.engine.query' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.metadata' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.planner' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.query' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.repository' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.repository.artifact' range='2.0.0'/>
+ <required namespace='java.package' name='org.eclipse.equinox.p2.repository.metadata' range='2.0.0'/>
+ </requires>
+ <artifacts size='1'>
+ <artifact classifier='osgi.bundle' id='org.eclipse.equinox.p2.replication' version='1.2.0.201004151326'/>
+ </artifacts>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+ <touchpointData size='1'>
+ <instructions size='1'>
+ <instruction key='manifest'>
+ Bundle-ManifestVersion: 2&#xA;Bundle-RequiredExecutionEnvironment: J2SE-1.5&#xA;Bundle-Localization: plugin&#xA;Require-Bundle: org.eclipse.ui,org.eclipse.core.runtime&#xA;Bundle-Name: Eclipse P2 Installation Replication&#xA;Bundle-Version: 1.2.0.201004151326&#xA;Bundle-Vendor: kane.zhu@windriver.com&#xA;Bundle-SymbolicName: org.eclipse.equinox.p2.replication;singleton:=true&#xA;Import-Package: org.eclipse.equinox.internal.p2.metadata.repository.io,org.eclipse.equinox.internal.p2.persistence,org.eclipse.equinox.internal.provisional.p2.director,org.eclipse.equinox.p2.core;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.engine;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.engine.query;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.metadata;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.planner;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.query;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.repository;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.repository.artifact;version=&quot;2.0.0&quot;,org.eclipse.equinox.p2.repository.metadata;version=&quot;2.0.0&quot;&#xA;Service-Component: OSGI-INF/replicator.xml&#xA;Bundle-ActivationPolicy: lazy&#xA;Manifest-Version: 1.0
+ </instruction>
+ </instructions>
+ </touchpointData>
+ </unit>
+ </units>
+ <repositories>
+ <repository uri='http://download.eclipse.org/releases/helios'/>
+ <repository uri='file:/folk/kzhu0/tmp/plugins/'/>
+ <repository uri='http://hge.javaforge.com/hgeclipse'/>
+ </repositories>
+</p2f>
diff --git a/bundles/org.eclipse.equinox.p2.testserver/src/org/eclipse/equinox/p2/testserver/Activator.java b/bundles/org.eclipse.equinox.p2.testserver/src/org/eclipse/equinox/p2/testserver/Activator.java
index 3a9860e89..746d63487 100644
--- a/bundles/org.eclipse.equinox.p2.testserver/src/org/eclipse/equinox/p2/testserver/Activator.java
+++ b/bundles/org.eclipse.equinox.p2.testserver/src/org/eclipse/equinox/p2/testserver/Activator.java
@@ -66,6 +66,7 @@ public class Activator implements BundleActivator, ServiceTrackerCustomizer {
try {
httpService.registerResources("/public", "/webfiles", null); //$NON-NLS-1$ //$NON-NLS-2$
+ httpService.registerResources("/importexport", "/webfiles/importexport", null); //$NON-NLS-1$ //$NON-NLS-2$
httpService.registerResources("/private", "/webfiles", secureHttpContext); //$NON-NLS-1$ //$NON-NLS-2$
httpService.registerResources("/never", "/webfiles", alwaysFail); //$NON-NLS-1$ //$NON-NLS-2$
httpService.registerResources("/flipflop", "/webfiles", flipFlop); //$NON-NLS-1$ //$NON-NLS-2$
diff --git a/bundles/org.eclipse.equinox.p2.testserver/webfiles/importexport/content.xml b/bundles/org.eclipse.equinox.p2.testserver/webfiles/importexport/content.xml
new file mode 100644
index 000000000..03cc70593
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.testserver/webfiles/importexport/content.xml
@@ -0,0 +1,47 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+
+<repository name='Installer Plan' type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository' version='1'>
+
+<properties size='1'>
+
+<property name='p2.timestamp' value='1239212031654'/>
+
+</properties>
+
+<units size='4'>
+
+<unit id='A' version='1.0.0'>
+
+<properties>
+<property name='org.eclipse.equinox.p2.type.group' value='true'/>
+
+</properties>
+
+<provides size='1'>
+<provided namespace='org.eclipse.equinox.p2.iu' name='A' version='1.0.0'/>
+</provides>
+
+<touchpoint id='null' version='0.0.0'/>
+
+<touchpointData size='1'/>
+
+</unit>
+
+<unit id='B' version='1.0.0' singleton='false'>
+
+<properties>
+<property name='org.eclipse.equinox.p2.type.group' value='true'/>
+</properties>
+
+<provides size='2'>
+<provided namespace='org.eclipse.equinox.p2.iu' name='B' version='1.0.0'/>
+<provided namespace='eclipse.touchpoint' name='bundle' version='1.0.0'/>
+</provides>
+ <touchpoint id='org.eclipse.equinox.p2.osgi' version='1.0.0'/>
+<touchpointData size='1'/>
+
+</unit>
+</units>
+
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java
index 12175f4c2..531192c99 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/P2ImportExport.java
@@ -17,6 +17,13 @@ import org.eclipse.core.runtime.IStatus;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
public interface P2ImportExport {
+ /**
+ *
+ * @param input
+ * @return iu listed in the file
+ * @throws IOException
+ * @throws VersionInCompatibleException if the given file version is not supported
+ */
List<IUDetail> importP2F(InputStream input) throws IOException;
IStatus exportP2F(OutputStream output, IInstallableUnit[] ius, IProgressMonitor monitor);
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/VersionInCompatibleException.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/VersionInCompatibleException.java
new file mode 100644
index 000000000..3759a42a2
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/VersionInCompatibleException.java
@@ -0,0 +1,24 @@
+/*******************************************************************************
+ * Copyright (c) 2011 WindRiver 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:
+ * WindRiver Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.importexport;
+
+public class VersionInCompatibleException extends RuntimeException {
+
+ public VersionInCompatibleException(String message) {
+ super(message);
+ }
+
+ /**
+ *
+ */
+ private static final long serialVersionUID = -7584242899366859010L;
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java
index 8b72bc642..accbfa792 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/ImportExportImpl.java
@@ -16,8 +16,8 @@ import java.util.*;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
import org.eclipse.equinox.internal.p2.importexport.P2ImportExport;
-import org.eclipse.equinox.internal.p2.importexport.persistence.P2FParser;
-import org.eclipse.equinox.internal.p2.importexport.persistence.P2FWriter;
+import org.eclipse.equinox.internal.p2.importexport.persistence.*;
+import org.eclipse.equinox.internal.p2.persistence.XMLWriter.ProcessingInstruction;
import org.eclipse.equinox.p2.core.IProvisioningAgent;
import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
@@ -127,7 +127,7 @@ public class ImportExportImpl implements P2ImportExport {
if (sub.isCanceled())
throw new OperationCanceledException();
try {
- P2FWriter writer = new P2FWriter(output, null);
+ P2FWriter writer = new P2FWriter(output, new ProcessingInstruction[] {ProcessingInstruction.makeTargetVersionInstruction(P2FConstants.P2F_ELEMENT, P2FConstants.CURRENT_VERSION)});
writer.write(features);
return Status.OK_STATUS;
} catch (UnsupportedEncodingException e) {
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
index c8b409626..01636381b 100755
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/messages.properties
@@ -48,7 +48,7 @@ ImportFromInstallationPage_DIALOG_DESCRIPTION=Import software items from the exi
ImportFromInstallationPage_INVALID_DESTINATION=Specify the path to a valid eclipse installation.
ImportFromInstallationPage_SELECT_COMPONENT=Select at least one available element to be installed.
io_IncompatibleVersion=\
-This p2f file is incompatible with this version of the application. Version {0}; expected {1}.
+This file is incompatible with this version of the application. Version {0}; expected {1}.
io_parseError=\
Error parsing .p2f file
Replicator_ExportJobName=Exporting selected software...
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
index bb609a7e7..efac5da35 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/internal/wizard/ImportPage.java
@@ -17,6 +17,7 @@ import java.util.*;
import java.util.List;
import org.eclipse.core.runtime.*;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.importexport.VersionInCompatibleException;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.internal.p2.ui.ProvUI;
import org.eclipse.equinox.internal.p2.ui.ProvUIMessages;
@@ -194,11 +195,12 @@ public class ImportPage extends AbstractImportPage implements ISelectableIUsPage
features = importexportService.importP2F(input);
viewer.setInput(features.toArray(new IUDetail[features.size()]));
input.close();
+ } catch (VersionInCompatibleException e) {
+ MessageDialog.openWarning(getShell(), Messages.ImportPage_TITLE, e.getMessage());
} catch (FileNotFoundException e) {
MessageDialog.openError(getShell(), Messages.ImportPage_TITLE, Messages.ImportPage_FILENOTFOUND);
} catch (IOException e) {
- //TODO
- e.printStackTrace();
+ MessageDialog.openError(getShell(), Messages.ImportPage_TITLE, e.getLocalizedMessage());
}
}
}
diff --git a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java
index ce550cb51..d1babd0a0 100644
--- a/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java
+++ b/bundles/org.eclipse.equinox.p2.ui.importexport/src/org/eclipse/equinox/internal/p2/importexport/persistence/P2FParser.java
@@ -16,6 +16,7 @@ import java.util.ArrayList;
import java.util.List;
import javax.xml.parsers.ParserConfigurationException;
import org.eclipse.equinox.internal.p2.importexport.IUDetail;
+import org.eclipse.equinox.internal.p2.importexport.VersionInCompatibleException;
import org.eclipse.equinox.internal.p2.importexport.internal.Messages;
import org.eclipse.equinox.internal.p2.persistence.XMLParser;
import org.eclipse.equinox.p2.metadata.*;
@@ -24,7 +25,7 @@ import org.osgi.framework.BundleContext;
import org.xml.sax.*;
public class P2FParser extends XMLParser implements P2FConstants {
- static final VersionRange XML_TOLERANCE = new VersionRange(CURRENT_VERSION, true, Version.createOSGi(2, 0, 0), false);
+ static final VersionRange XML_TOLERANCE = new VersionRange(Version.createOSGi(1, 0, 0), true, Version.createOSGi(2, 0, 0), false);
List<IUDetail> iusListed;
@@ -46,7 +47,7 @@ public class P2FParser extends XMLParser implements P2FConstants {
}
@Override
- public void startElement(String name, Attributes attributes) throws SAXException {
+ public void startElement(String name, Attributes attributes) {
checkCancel();
}
@@ -68,7 +69,7 @@ public class P2FParser extends XMLParser implements P2FConstants {
}
@Override
- public void startElement(String name, Attributes attributes) throws SAXException {
+ public void startElement(String name, Attributes attributes) {
if (name.equals(REPOSITORY_ELEMENT)) {
new RepositoryHandler(this, attributes, uris);
}
@@ -147,29 +148,28 @@ public class P2FParser extends XMLParser implements P2FConstants {
}
@Override
- public void processingInstruction(String target, String data) throws SAXException {
- Version repositoryVersion = extractPIVersion(target, data);
- if (!XML_TOLERANCE.isIncluded(repositoryVersion)) {
- throw new SAXException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, XML_TOLERANCE));
+ public void processingInstruction(String target, String data) {
+ if (P2F_ELEMENT.equals(target)) {
+ Version repositoryVersion = extractPIVersion(target, data);
+ if (!XML_TOLERANCE.isIncluded(repositoryVersion)) {
+ throw new VersionInCompatibleException(NLS.bind(Messages.io_IncompatibleVersion, repositoryVersion, XML_TOLERANCE));
+ }
}
}
}
final class P2FHandler extends RootHandler {
- private final String[] required = new String[] {VERSION_ATTRIBUTE};
+ private final String[] required = new String[] {};
private final String[] optional = new String[] {};
- private String[] attrValues = new String[required.length + optional.length];
-
private IUsHandler iusHandler;
@Override
protected void handleRootAttributes(Attributes attributes) {
- attrValues = parseAttributes(attributes, required, optional);
- attrValues[0] = checkVersion(P2F_ELEMENT, VERSION_ATTRIBUTE, attrValues[0]).toString();
+ parseAttributes(attributes, required, optional);
}
@Override
- public void startElement(String name, Attributes attributes) throws SAXException {
+ public void startElement(String name, Attributes attributes) {
if (IUS_ELEMENT.equals(name)) {
if (iusHandler == null) {
iusHandler = new IUsHandler(this, attributes);
@@ -184,7 +184,8 @@ public class P2FParser extends XMLParser implements P2FConstants {
@Override
protected void finished() {
if (isValidXML()) {
- iusListed = iusHandler.getIUs();
+ if (iusHandler != null)
+ iusListed = iusHandler.getIUs();
}
}
}
@@ -219,6 +220,9 @@ public class P2FParser extends XMLParser implements P2FConstants {
}
public List<IUDetail> getIUs() {
+ if (iusListed == null) {
+ iusListed = new ArrayList<IUDetail>();
+ }
return iusListed;
}

Back to the top