Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault2015-04-28 10:58:09 -0400
committerPascal Rapicault2015-04-28 12:13:48 -0400
commit9b1fa1cad604207e24f41d6affcb28aa7c011ffb (patch)
treeb0b19aadc828e96bf5705174886a894891caa50a
parent60c11f0bbcbb5ed7ec2a7dc58625330b49b714da (diff)
downloadrt.equinox.p2-9b1fa1cad604207e24f41d6affcb28aa7c011ffb.tar.gz
rt.equinox.p2-9b1fa1cad604207e24f41d6affcb28aa7c011ffb.tar.xz
rt.equinox.p2-9b1fa1cad604207e24f41d6affcb28aa7c011ffb.zip
Bug 464614 - Use XZ as compression formats of metadata filesI20150429-0800I20150428-2000
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF3
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/plugin.xml5
-rw-r--r--bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java124
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java57
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllTests.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/XZedRepositoryTest.java64
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.jarbin0 -> 399 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.xml.xzbin0 -> 304 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/p2.index3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.jarbin0 -> 399 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.xml.xzbin0 -> 304 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/p2.index3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml13
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml.xzbin0 -> 304 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/p2.index3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/content.xml.xz1
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/p2.index3
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/content.xml.xzbin0 -> 304 bytes
-rw-r--r--bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/p2.index3
-rw-r--r--org.eclipse.equinox.p2.releng/p2-mars.target8
20 files changed, 289 insertions, 5 deletions
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
index 28ff7ad26..a5cfb057c 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/META-INF/MANIFEST.MF
@@ -18,7 +18,8 @@ Export-Package: org.eclipse.equinox.internal.p2.metadata.repository;
org.eclipse.equinox.internal.p2.metadata.repository.io;x-friends:="org.eclipse.equinox.p2.engine",
org.eclipse.equinox.p2.metadata.io
Require-Bundle: org.eclipse.equinox.common;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.equinox.registry
+ org.eclipse.equinox.registry,
+ org.tukaani.xz;bundle-version="1.3.0"
Import-Package: javax.xml.parsers,
org.eclipse.equinox.internal.p2.core.helpers,
org.eclipse.equinox.internal.p2.metadata,
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.xml b/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.xml
index 3deee9519..36c77e732 100644
--- a/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.xml
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/plugin.xml
@@ -7,6 +7,11 @@
<factory class="org.eclipse.equinox.internal.p2.metadata.repository.SimpleMetadataRepositoryFactory"/>
</extension>
+ <extension id="XZedRepository" point="org.eclipse.equinox.p2.metadata.repository.metadataRepositories">
+ <filter suffix="content.xml.xz"/>
+ <factory class="org.eclipse.equinox.internal.p2.metadata.repository.XZedSimpleMetadataRepositoryFactory"/>
+ </extension>
+
<extension id="compositeRepository" point="org.eclipse.equinox.p2.metadata.repository.metadataRepositories">
<filter suffix="compositeContent.xml"/>
<factory class="org.eclipse.equinox.internal.p2.metadata.repository.CompositeMetadataRepositoryFactory"/>
diff --git a/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java
new file mode 100644
index 000000000..490ff3288
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/XZedSimpleMetadataRepositoryFactory.java
@@ -0,0 +1,124 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Rapicorp, Inc 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:
+ * Rapicorp, Inc - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.internal.p2.metadata.repository;
+
+import java.io.*;
+import java.net.URI;
+import java.util.Map;
+import org.eclipse.core.runtime.*;
+import org.eclipse.equinox.internal.p2.core.helpers.Tracing;
+import org.eclipse.equinox.internal.p2.repository.CacheManager;
+import org.eclipse.equinox.p2.core.ProvisionException;
+import org.eclipse.equinox.p2.repository.IRepositoryManager;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory;
+import org.eclipse.osgi.util.NLS;
+import org.tukaani.xz.XZInputStream;
+
+public class XZedSimpleMetadataRepositoryFactory extends MetadataRepositoryFactory {
+ private static final String REPOSITORY_FILENAME = "content.xml.xz"; //$NON-NLS-1$
+ private static final String PROTOCOL_FILE = "file"; //$NON-NLS-1$
+
+ public IMetadataRepository create(URI location, String name, String type, Map<String, String> properties) {
+ if (location.getScheme().equals("file")) //$NON-NLS-1$
+ return new LocalMetadataRepository(getAgent(), location, name, properties);
+ return new URLMetadataRepository(getAgent(), location, name, properties);
+ }
+
+ /**
+ * Returns a file in the local file system that contains the contents of the
+ * metadata repository at the given location.
+ */
+ private File getLocalFile(URI location, IProgressMonitor monitor) throws IOException, ProvisionException {
+ File localFile = null;
+ URI xzLocation = URIUtil.append(location, REPOSITORY_FILENAME);
+ // If the repository is local, we can return the repository file directly
+ if (PROTOCOL_FILE.equals(xzLocation.getScheme())) {
+ //look for a compressed local file
+ localFile = URIUtil.toFile(xzLocation);
+ if (localFile.exists())
+ return localFile;
+ String msg = NLS.bind(Messages.io_failedRead, location);
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, null));
+ }
+ // file is not local, create a cache of the repository metadata
+ CacheManager cache = (CacheManager) getAgent().getService(CacheManager.SERVICE_NAME);
+ if (cache == null)
+ throw new IllegalArgumentException("Cache manager service not available"); //$NON-NLS-1$
+ localFile = cache.createCacheFromFile(URIUtil.append(location, REPOSITORY_FILENAME), monitor);
+ if (localFile == null) {
+ // there is no remote file in either form - this should not really happen as
+ // createCache should bail out with exception if something is wrong. This is an internal
+ // error.
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, Messages.repoMan_internalError, null));
+ }
+ return localFile;
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.equinox.p2.repository.metadata.spi.MetadataRepositoryFactory#load(java.net.URL, org.eclipse.core.runtime.IProgressMonitor)
+ */
+ public IMetadataRepository load(URI location, int flags, IProgressMonitor monitor) throws ProvisionException {
+ long time = 0;
+ final String debugMsg = "Validating and loading metadata repository "; //$NON-NLS-1$
+ if (Tracing.DEBUG_METADATA_PARSING) {
+ Tracing.debug(debugMsg + location);
+ time = -System.currentTimeMillis();
+ }
+ SubMonitor sub = SubMonitor.convert(monitor, 400);
+ try {
+ File localFile = getLocalFile(location, sub.newChild(300));
+ InputStream stream = new BufferedInputStream(new FileInputStream(localFile));
+ XZInputStream descriptorStream = new XZInputStream(stream);
+ try {
+ //parse the repository descriptor file
+ sub.setWorkRemaining(100);
+ IMetadataRepository result = new MetadataRepositoryIO(getAgent()).read(localFile.toURL(), descriptorStream, sub.newChild(100));
+ if (result != null && (flags & IRepositoryManager.REPOSITORY_HINT_MODIFIABLE) > 0 && !result.isModifiable())
+ return null;
+ if (result instanceof LocalMetadataRepository)
+ ((LocalMetadataRepository) result).initializeAfterLoad(location);
+ if (result instanceof URLMetadataRepository)
+ ((URLMetadataRepository) result).initializeAfterLoad(location);
+ if (Tracing.DEBUG_METADATA_PARSING) {
+ time += System.currentTimeMillis();
+ Tracing.debug(debugMsg + "time (ms): " + time); //$NON-NLS-1$
+ }
+ return result;
+ } finally {
+ safeClose(descriptorStream);
+ safeClose(stream);
+ }
+ } catch (FileNotFoundException e) {
+ String msg = NLS.bind(Messages.io_failedRead, location);
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, msg, e));
+ } catch (IOException e) {
+ String msg = NLS.bind(Messages.io_failedRead, location);
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, msg, e));
+ } finally {
+ if (monitor != null)
+ monitor.done();
+ }
+ }
+
+ /**
+ * Closes a stream, ignoring any secondary exceptions
+ */
+ private void safeClose(InputStream stream) {
+ if (stream == null)
+ return;
+ try {
+ stream.close();
+ } catch (IOException e) {
+ //ignore
+ }
+ }
+}
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java
index 95afb681f..97c239d24 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/CacheManager.java
@@ -86,6 +86,57 @@ public class CacheManager {
return repositoryLocation.hashCode();
}
+ public File createCacheFromFile(URI remoteFile, IProgressMonitor monitor) throws ProvisionException, IOException {
+ if (!isURL(remoteFile)) {
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_NOT_FOUND, NLS.bind(Messages.CacheManager_CannotLoadNonUrlLocation, remoteFile), null));
+ }
+
+ SubMonitor submonitor = SubMonitor.convert(monitor, 1000);
+ try {
+ File cacheFile = getCacheFile(remoteFile);
+
+ boolean stale = true;
+ long lastModified = cacheFile.lastModified();
+ long lastModifiedRemote = 0L;
+
+ // bug 269588 - server may return 0 when file exists, so extra flag is needed
+ try {
+ lastModifiedRemote = transport.getLastModified(remoteFile, submonitor.newChild(1));
+ if (lastModifiedRemote <= 0)
+ LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "Server returned lastModified <= 0 for " + remoteFile)); //$NON-NLS-1$
+ } catch (AuthenticationFailedException e) {
+ // it is not meaningful to continue - the credentials are for the server
+ // do not pass the exception - it gives no additional meaningful user information
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_AUTHENTICATION, NLS.bind(Messages.CacheManager_AuthenticationFaileFor_0, remoteFile), null));
+ } catch (CoreException e) {
+ // give up on a timeout - if we did not get a 404 on the jar, we will just prolong the pain
+ // by (almost certainly) also timing out on the xml.
+ if (e.getStatus() != null && e.getStatus().getException() != null) {
+ Throwable ex = e.getStatus().getException();
+ if (ex.getClass() == java.net.SocketTimeoutException.class)
+ throw new ProvisionException(new Status(IStatus.ERROR, Activator.ID, ProvisionException.REPOSITORY_FAILED_READ, NLS.bind(Messages.CacheManager_FailedCommunicationWithRepo_0, remoteFile), ex));
+ }
+ } catch (OperationCanceledException e) {
+ // must pass this on
+ throw e;
+ } catch (Exception e) {
+ // not ideal, just skip the jar on error, and try the xml instead - report errors for
+ // the xml.
+ }
+
+ stale = lastModifiedRemote != lastModified;
+ if (!stale)
+ return cacheFile;
+
+ // The cache is stale or missing, so we need to update it from the remote location
+ updateCache(cacheFile, remoteFile, lastModifiedRemote, submonitor);
+ return cacheFile;
+ } finally {
+ submonitor.done();
+ }
+
+ }
+
/**
* Returns a local cache file with the contents of the given remote location,
* or <code>null</code> if a local cache could not be created.
@@ -264,6 +315,12 @@ public class CacheManager {
return files;
}
+ private File getCacheFile(URI url) {
+ File dataAreaFile = getCacheDirectory();
+ int hashCode = computeHash(url);
+ return new File(dataAreaFile, Integer.toString(hashCode));
+ }
+
private static boolean isURL(URI location) {
try {
new URL(location.toASCIIString());
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllTests.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllTests.java
index 339f7c9d4..801bd9b9b 100644
--- a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllTests.java
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/AllTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2007, 2011 IBM Corporation and others.
+ * Copyright (c) 2007, 2015 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
@@ -7,6 +7,7 @@
*
* Contributors:
* IBM Corporation - initial API and implementation
+ * Rapicorp, Inc - addition implementation
*******************************************************************************/
package org.eclipse.equinox.p2.tests.metadata.repository;
@@ -28,6 +29,7 @@ public class AllTests extends TestCase {
suite.addTestSuite(MetadataRepositoryManagerTest.class);
suite.addTestSuite(NoFailOver.class);
suite.addTestSuite(SiteIndexFileTest.class);
+ suite.addTestSuite(XZedRepositoryTest.class);
// suite.addTestSuite(ResumeDownloadTest.class);
// DISABLING until we get a test build
// AllServerTests.addToSuite(suite);
diff --git a/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/XZedRepositoryTest.java b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/XZedRepositoryTest.java
new file mode 100644
index 000000000..5f5d2f80f
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/src/org/eclipse/equinox/p2/tests/metadata/repository/XZedRepositoryTest.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Rapicorp, Inc 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:
+ * Rapicorp, Inc - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.equinox.p2.tests.metadata.repository;
+
+import org.eclipse.core.runtime.OperationCanceledException;
+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.query.IQueryResult;
+import org.eclipse.equinox.p2.query.QueryUtil;
+import org.eclipse.equinox.p2.repository.metadata.IMetadataRepository;
+import org.eclipse.equinox.p2.tests.AbstractProvisioningTest;
+import org.junit.Test;
+
+public class XZedRepositoryTest extends AbstractProvisioningTest {
+
+ @Test
+ public void testLoadContentJarAndXZ() throws ProvisionException, OperationCanceledException {
+ IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(getTestData("xzedRepo", "testData/xzRepoTests/contentJarAndXZ").toURI(), null);
+ IQueryResult<IInstallableUnit> units = repo.query(QueryUtil.createIUQuery("testIU", Version.create("2.0.0")), null);
+ assertEquals(1, units.toSet().size());
+ }
+
+ @Test
+ public void testLoadXzAndContentJar() throws ProvisionException, OperationCanceledException {
+ IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(getTestData("xzedRepo", "testData/xzRepoTests/xzAndContentJar").toURI(), null);
+ IQueryResult<IInstallableUnit> units = repo.query(QueryUtil.createIUQuery("iuFromXZ", Version.create("2.0.0")), null);
+ assertEquals(1, units.toSet().size());
+ }
+
+ @Test
+ public void testLoadXzAndContentXML() throws ProvisionException, OperationCanceledException {
+ IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(getTestData("xzedRepo", "testData/xzRepoTests/xzAndContentXML").toURI(), null);
+ IQueryResult<IInstallableUnit> units = repo.query(QueryUtil.createIUQuery("iuFromXZ", Version.create("2.0.0")), null);
+ assertEquals(1, units.toSet().size());
+ }
+
+ @Test
+ public void testLoadXzBusted() throws ProvisionException, OperationCanceledException {
+ boolean repoCanLoad = true;
+ try {
+ getMetadataRepositoryManager().loadRepository(getTestData("xzedRepo", "testData/xzRepoTests/xzBusted").toURI(), null);
+ } catch (ProvisionException e) {
+ repoCanLoad = false;
+ }
+ assertFalse(repoCanLoad);
+ }
+
+ @Test
+ public void testLoadXzOnly() throws ProvisionException, OperationCanceledException {
+ IMetadataRepository repo = getMetadataRepositoryManager().loadRepository(getTestData("xzedRepo", "testData/xzRepoTests/xzOnly").toURI(), null);
+ IQueryResult<IInstallableUnit> units = repo.query(QueryUtil.createIUQuery("iuFromXZ", Version.create("2.0.0")), null);
+ assertEquals(1, units.toSet().size());
+ }
+
+}
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.jar b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.jar
new file mode 100644
index 000000000..8659c74d3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.xml.xz b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.xml.xz
new file mode 100644
index 000000000..b4010f8b1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/content.xml.xz
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/p2.index b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/p2.index
new file mode 100644
index 000000000..7d7614d96
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/contentJarAndXZ/p2.index
@@ -0,0 +1,3 @@
+metadata.repository.factory.order= content.xml,content.xml.xz,!
+version=1
+
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.jar b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.jar
new file mode 100644
index 000000000..8659c74d3
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.jar
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.xml.xz b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.xml.xz
new file mode 100644
index 000000000..b4010f8b1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/content.xml.xz
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/p2.index b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/p2.index
new file mode 100644
index 000000000..337a00d01
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentJar/p2.index
@@ -0,0 +1,3 @@
+metadata.repository.factory.order= content.xml.xz,content.xml,!
+version=1
+
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml
new file mode 100644
index 000000000..5d34bfbdb
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml
@@ -0,0 +1,13 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<?metadataRepository version='1.1.0'?>
+<repository name='pi.eclipse-repository'
+ type='org.eclipse.equinox.internal.p2.metadata.repository.LocalMetadataRepository'
+ version='1'>
+ <units size='1'>
+ <unit id='testIU' version='2.0.0' singleton='false'>
+ <provides size='1'>
+ <provided namespace='org.eclipse.equinox.p2.iu' name='testIU' version='2.0.0' />
+ </provides>
+ </unit>
+ </units>
+</repository>
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml.xz b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml.xz
new file mode 100644
index 000000000..b4010f8b1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/content.xml.xz
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/p2.index b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/p2.index
new file mode 100644
index 000000000..337a00d01
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzAndContentXML/p2.index
@@ -0,0 +1,3 @@
+metadata.repository.factory.order= content.xml.xz,content.xml,!
+version=1
+
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/content.xml.xz b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/content.xml.xz
new file mode 100644
index 000000000..3306f9189
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/content.xml.xz
@@ -0,0 +1 @@
+This is an empty file. \ No newline at end of file
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/p2.index b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/p2.index
new file mode 100644
index 000000000..5c7a65533
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzBusted/p2.index
@@ -0,0 +1,3 @@
+metadata.repository.factory.order= content.xml.xz,!
+version=1
+
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/content.xml.xz b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/content.xml.xz
new file mode 100644
index 000000000..b4010f8b1
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/content.xml.xz
Binary files differ
diff --git a/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/p2.index b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/p2.index
new file mode 100644
index 000000000..5c7a65533
--- /dev/null
+++ b/bundles/org.eclipse.equinox.p2.tests/testData/xzRepoTests/xzOnly/p2.index
@@ -0,0 +1,3 @@
+metadata.repository.factory.order= content.xml.xz,!
+version=1
+
diff --git a/org.eclipse.equinox.p2.releng/p2-mars.target b/org.eclipse.equinox.p2.releng/p2-mars.target
index daef9fa1f..a4f295196 100644
--- a/org.eclipse.equinox.p2.releng/p2-mars.target
+++ b/org.eclipse.equinox.p2.releng/p2-mars.target
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<?pde version="3.8"?><target name="p2 - target to develop p2" sequenceNumber="1">
+<?pde version="3.8"?><target name="p2 - target to develop p2" sequenceNumber="2">
<locations>
<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
<unit id="org.eclipse.platform.sdk" version="0.0.0"/>
@@ -7,7 +7,9 @@
<unit id="org.eclipse.test.feature.group" version="0.0.0"/>
<repository location="http://download.eclipse.org/eclipse/updates/4.5-I-builds"/>
</location>
+<location includeAllPlatforms="false" includeConfigurePhase="false" includeMode="planner" includeSource="true" type="InstallableUnit">
+<unit id="org.tukaani.xz" version="1.3.0.v201308270617"/>
+<repository location="http://download.eclipse.org/tools/orbit/downloads/drops/S20150316021154/repository/"/>
+</location>
</locations>
</target>
-
-

Back to the top