diff options
author | Doug Schaefer | 2008-12-07 19:49:51 +0000 |
---|---|---|
committer | Doug Schaefer | 2008-12-07 19:49:51 +0000 |
commit | d7367d54be4db2486ea682de1a055e0966224e7c (patch) | |
tree | afb1becb5969d8f3028c545a8bca679e460c0d9d /p2/org.eclipse.cdt.p2 | |
parent | c37f9bd7a2f4cce1899b907fa5b4b053ac72bdae (diff) | |
download | org.eclipse.cdt-d7367d54be4db2486ea682de1a055e0966224e7c.tar.gz org.eclipse.cdt-d7367d54be4db2486ea682de1a055e0966224e7c.tar.xz org.eclipse.cdt-d7367d54be4db2486ea682de1a055e0966224e7c.zip |
Productized p2 for sdks.
Diffstat (limited to 'p2/org.eclipse.cdt.p2')
-rw-r--r-- | p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF | 4 | ||||
-rw-r--r-- | p2/org.eclipse.cdt.p2/about.html | 24 | ||||
-rw-r--r-- | p2/org.eclipse.cdt.p2/about.ini | 24 | ||||
-rw-r--r-- | p2/org.eclipse.cdt.p2/about.mappings | 9 | ||||
-rw-r--r-- | p2/org.eclipse.cdt.p2/build.properties | 7 | ||||
-rw-r--r-- | p2/org.eclipse.cdt.p2/eclipse32.gif | bin | 0 -> 1706 bytes | |||
-rw-r--r-- | p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java | 45 |
7 files changed, 92 insertions, 21 deletions
diff --git a/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF b/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF index 6b9a8f9448a..aef0dd5102c 100644 --- a/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF +++ b/p2/org.eclipse.cdt.p2/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: CDT P2 customizations for SDKs Bundle-SymbolicName: org.eclipse.cdt.p2;singleton:=true -Bundle-Version: 5.0.0 +Bundle-Version: 5.0.0.qualifier Bundle-Activator: org.eclipse.cdt.p2.Activator -Bundle-Vendor: eclipse.org +Bundle-Vendor: Eclipse.org Require-Bundle: org.eclipse.core.runtime, org.eclipse.equinox.p2.artifact.repository;bundle-version="1.0.2", org.eclipse.equinox.p2.core;bundle-version="1.0.0", diff --git a/p2/org.eclipse.cdt.p2/about.html b/p2/org.eclipse.cdt.p2/about.html new file mode 100644 index 00000000000..d7c511887d6 --- /dev/null +++ b/p2/org.eclipse.cdt.p2/about.html @@ -0,0 +1,24 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"><head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>About</title></head> + +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>June 22, 2007</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p> + +</body></html>
\ No newline at end of file diff --git a/p2/org.eclipse.cdt.p2/about.ini b/p2/org.eclipse.cdt.p2/about.ini new file mode 100644 index 00000000000..b3cd8d70ba9 --- /dev/null +++ b/p2/org.eclipse.cdt.p2/about.ini @@ -0,0 +1,24 @@ +# about.ini +# contains information about a feature +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# "%key" are externalized strings defined in about.properties +# This file does not need to be translated. + +# Property "aboutText" contains blurb for "About" dialog (translated) +aboutText=%blurb + +# Property "windowImage" contains path to window icon (16x16) +# needed for primary features only + +# Property "featureImage" contains path to feature image (32x32) +featureImage=eclipse32.gif + +# Property "aboutImage" contains path to product image (500x330 or 115x164) +# needed for primary features only + +# Property "appName" contains name of the application (translated) +# needed for primary features only + +# Property "welcomePerspective" contains the id of the perspective in which the +# welcome page is to be opened. +# optional diff --git a/p2/org.eclipse.cdt.p2/about.mappings b/p2/org.eclipse.cdt.p2/about.mappings new file mode 100644 index 00000000000..0824105e69d --- /dev/null +++ b/p2/org.eclipse.cdt.p2/about.mappings @@ -0,0 +1,9 @@ +# about.mappings +# contains fill-ins for about.properties +# java.io.Properties file (ISO 8859-1 with "\" escapes) +# This file does not need to be translated. + +# The following should contain the build version. +# e.g. "0=20020612" +# This value will be added automaticaly via the build scripts +0=@build@
\ No newline at end of file diff --git a/p2/org.eclipse.cdt.p2/build.properties b/p2/org.eclipse.cdt.p2/build.properties index e9863e281ea..6b7cd92b987 100644 --- a/p2/org.eclipse.cdt.p2/build.properties +++ b/p2/org.eclipse.cdt.p2/build.properties @@ -2,4 +2,9 @@ source.. = src/ output.. = bin/ bin.includes = META-INF/,\ .,\ - plugin.xml + plugin.xml,\ + about.html,\ + about.ini,\ + about.mappings,\ + eclipse32.gif,\ + plugin.properties diff --git a/p2/org.eclipse.cdt.p2/eclipse32.gif b/p2/org.eclipse.cdt.p2/eclipse32.gif Binary files differnew file mode 100644 index 00000000000..e6ad7ccd75b --- /dev/null +++ b/p2/org.eclipse.cdt.p2/eclipse32.gif diff --git a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java index 1aade3cc226..fe5f16fdc5f 100644 --- a/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java +++ b/p2/org.eclipse.cdt.p2/src/org/eclipse/cdt/p2/internal/repo/artifact/InstallArtifactRepository.java @@ -62,8 +62,9 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { private static final String DESCRIPTION = "Wind River Metadata Repository"; //$NON-NLS-1$ private static final String PROVIDER = "Wind River"; //$NON-NLS-1$ - - private Map<IArtifactKey, IArtifactDescriptor> artifacts = new HashMap<IArtifactKey, IArtifactDescriptor>(); + // Map from artifact id to artifact descriptor. We only allow one version of each artifact + // to be installed at a time. + private Map<String, IArtifactDescriptor> artifacts = new HashMap<String, IArtifactDescriptor>(); public InstallArtifactRepository(URL aLocation, String aName, Map aProperties) { super(aName, InstallArtifactRepository.class.getName(), VERSION, aLocation, DESCRIPTION, PROVIDER, aProperties); @@ -85,7 +86,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { InstallArtifactRepository(String _name, String _type, String _version, URL _location, String _description, String _provider, Set<ArtifactDescriptor> _artifacts, Map _properties) { super(_name, _type, _version, _location, _description, _provider, _properties); for (IArtifactDescriptor descriptor : _artifacts) - artifacts.put(descriptor.getArtifactKey(), descriptor); + artifacts.put(descriptor.getArtifactKey().getId(), descriptor); } public static URL getActualLocation(URL base) { @@ -139,7 +140,10 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { @Override public boolean contains(IArtifactKey key) { - return artifacts.containsKey(key); + IArtifactDescriptor desc = artifacts.get(key.getId()); + if (desc == null) + return false; + return desc.getArtifactKey().equals(key); } @Override @@ -159,8 +163,12 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { @Override public IArtifactKey[] getArtifactKeys() { - Set<IArtifactKey> keyset = artifacts.keySet(); - return keyset.toArray(new IArtifactKey[keyset.size()]); + Collection<IArtifactDescriptor> descs = artifacts.values(); + IArtifactKey[] keys = new IArtifactKey[descs.size()]; + int i = 0; + for (IArtifactDescriptor desc : descs) + keys[i++] = desc.getArtifactKey(); + return keys; } @Override @@ -172,7 +180,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { @Override public synchronized void addDescriptor(IArtifactDescriptor descriptor) { super.addDescriptor(descriptor); - artifacts.put(descriptor.getArtifactKey(), descriptor); + artifacts.put(descriptor.getArtifactKey().getId(), descriptor); save(); } @@ -180,7 +188,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { public synchronized void addDescriptors(IArtifactDescriptor[] descriptors) { super.addDescriptors(descriptors); for (IArtifactDescriptor descriptor : descriptors) - artifacts.put(descriptor.getArtifactKey(), descriptor); + artifacts.put(descriptor.getArtifactKey().getId(), descriptor); save(); } @@ -188,7 +196,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { return artifacts.values(); } - private File getFileListFile(IArtifactKey artifact) throws IOException { + private File getFileListFile(String artifact) throws IOException { File file; try { file = new File(URLUtil.toURI(location)); @@ -197,7 +205,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { } if (file.getName().equals(FILENAME)) file = file.getParentFile(); - return new File(file, artifact.getId() + "_" + artifact.getVersion()); //$NON-NLS-1$ + return new File(file, artifact + ".txt"); //$NON-NLS-1$ } @Override @@ -206,11 +214,12 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { super.getOutputStream(descriptor); // Add the descriptor to the list and save it - // TODO what if it's already there? - if (!contains(descriptor)) - addDescriptor(descriptor); + IArtifactDescriptor oldDesc = artifacts.get(descriptor.getArtifactKey().getId()); + if (oldDesc != null) + removeDescriptor(oldDesc); + addDescriptor(descriptor); - // Return the extractor + // Start the extractor try { String installDirName = (String)getProperties().get(INSTALL_DIR); if (installDirName == null) @@ -226,7 +235,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { // TODO a zip extractor } else { TarExtractor extractor = new TarExtractor(in, installDir, - new FileListWriter(getFileListFile(descriptor.getArtifactKey())), + new FileListWriter(getFileListFile(descriptor.getArtifactKey().getId())), compression); extractor.start(); } @@ -237,7 +246,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { } } - private void deleteFiles(IArtifactKey artifact) { + private void deleteFiles(String artifact) { File fileListFile = null; try { fileListFile = getFileListFile(artifact); @@ -258,7 +267,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { @Override public void removeAll() { super.removeAll(); - for (IArtifactKey artifact : artifacts.keySet()) + for (String artifact : artifacts.keySet()) deleteFiles(artifact); artifacts.clear(); save(); @@ -272,7 +281,7 @@ public class InstallArtifactRepository extends AbstractArtifactRepository { @Override public void removeDescriptor(IArtifactKey key) { super.removeDescriptor(key); - deleteFiles(key); + deleteFiles(key.getId()); artifacts.remove(key); save(); } |