diff options
author | Simon Kaegi | 2009-03-13 21:02:32 +0000 |
---|---|---|
committer | Simon Kaegi | 2009-03-13 21:02:32 +0000 |
commit | 11dd3dc2337b44b7ee20f2dd96c8c94c0fdd87b7 (patch) | |
tree | 78806474c89cd5777358ad63de38ffc8bf7009f2 /bundles | |
parent | 36242f8238d927ae354cec00479f6c99e826d3c7 (diff) | |
download | rt.equinox.p2-11dd3dc2337b44b7ee20f2dd96c8c94c0fdd87b7.tar.gz rt.equinox.p2-11dd3dc2337b44b7ee20f2dd96c8c94c0fdd87b7.tar.xz rt.equinox.p2-11dd3dc2337b44b7ee20f2dd96c8c94c0fdd87b7.zip |
Bug 268202 [reconciler] Dropins repo shown in the list of known repositories
Diffstat (limited to 'bundles')
3 files changed, 12 insertions, 14 deletions
diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java index 9141c2afb..0eade47b6 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/Activator.java @@ -23,6 +23,7 @@ import org.eclipse.equinox.internal.p2.update.PathUtil; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; +import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryWatcher; import org.eclipse.equinox.internal.provisional.p2.engine.IProfile; import org.eclipse.equinox.internal.provisional.p2.engine.IProfileRegistry; @@ -66,6 +67,7 @@ public class Activator implements BundleActivator { IMetadataRepository repository = factory.create(location, name, ExtensionLocationMetadataRepository.TYPE, properties); //we need to add the concrete repository to the repository manager, or its properties will not be correct ((MetadataRepositoryManager) manager).addRepository(repository); + manager.setRepositoryProperty(location, IRepository.PROP_SYSTEM, String.valueOf(true)); return repository; } @@ -80,7 +82,9 @@ public class Activator implements BundleActivator { IMetadataRepositoryManager manager = (IMetadataRepositoryManager) ServiceHelper.getService(context, IMetadataRepositoryManager.class.getName()); if (manager == null) throw new IllegalStateException("MetadataRepositoryManager not registered."); //$NON-NLS-1$ - return manager.loadRepository(location, monitor); + IMetadataRepository repository = manager.loadRepository(location, monitor); + manager.setRepositoryProperty(location, IRepository.PROP_SYSTEM, String.valueOf(true)); + return repository; } /** @@ -101,6 +105,7 @@ public class Activator implements BundleActivator { IArtifactRepository repository = factory.create(location, name, ExtensionLocationArtifactRepository.TYPE, properties); //we need to add the concrete repository to the repository manager, or its properties will not be correct ((ArtifactRepositoryManager) manager).addRepository(repository); + manager.setRepositoryProperty(location, IRepository.PROP_SYSTEM, String.valueOf(true)); return repository; } @@ -115,7 +120,9 @@ public class Activator implements BundleActivator { IArtifactRepositoryManager manager = (IArtifactRepositoryManager) ServiceHelper.getService(context, IArtifactRepositoryManager.class.getName()); if (manager == null) throw new IllegalStateException("ArtifactRepositoryManager not registered."); //$NON-NLS-1$ - return manager.loadRepository(location, monitor); + IArtifactRepository repository = manager.loadRepository(location, monitor); + manager.setRepositoryProperty(location, IRepository.PROP_SYSTEM, String.valueOf(true)); + return repository; } /* diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java index 50eee4835..9b780727b 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/DropinsRepositoryListener.java @@ -135,6 +135,7 @@ public class DropinsRepositoryListener extends RepositoryListener { return file.toURI(); } + //TODO: Should we remove this? We only should support directly runnable repos if (fileName.endsWith(ZIP) || fileName.endsWith(JAR)) return new URI("jar:" + file.toURI() + "!/"); //$NON-NLS-1$ //$NON-NLS-2$ @@ -165,15 +166,11 @@ public class DropinsRepositoryListener extends RepositoryListener { return linkedFile.getCanonicalFile().toURI(); } - public void getMetadataRepository(URI repoURL, Properties extraProperties) { + public void getMetadataRepository(URI repoURL, Properties properties) { try { IMetadataRepository repository = null; try { ExtensionLocationMetadataRepository.validate(repoURL, null); - Map properties = new HashMap(); - properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString()); - if (extraProperties != null) - properties.putAll(extraProperties); repository = Activator.createExtensionLocationMetadataRepository(repoURL, "dropins metadata repo: " + repoURL, properties); //$NON-NLS-1$ } catch (ProvisionException e) { repository = Activator.loadMetadataRepository(repoURL, null); @@ -184,15 +181,11 @@ public class DropinsRepositoryListener extends RepositoryListener { } } - public void getArtifactRepository(URI repoURL, Properties extraProperties) { + public void getArtifactRepository(URI repoURL, Properties properties) { try { IArtifactRepository repository = null; try { ExtensionLocationArtifactRepository.validate(repoURL, null); - Map properties = new HashMap(); - properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString()); - if (extraProperties != null) - properties.putAll(extraProperties); repository = Activator.createExtensionLocationArtifactRepository(repoURL, "dropins artifact repo: " + repoURL, properties); //$NON-NLS-1$ // fall through here and call the load which then adds the repo to the manager's list } catch (ProvisionException ex) { diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java index 96baab05b..dfc444126 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java @@ -20,7 +20,6 @@ import org.eclipse.equinox.internal.p2.extensionlocation.*; import org.eclipse.equinox.internal.p2.update.*; import org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepository; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; -import org.eclipse.equinox.internal.provisional.p2.core.repository.IRepository; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener; import org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository; import org.eclipse.osgi.util.NLS; @@ -213,7 +212,6 @@ public class PlatformXmlListener extends DirectoryChangeListener { Feature[] listFeatures = site.getPolicy().equals(Site.POLICY_USER_INCLUDE) ? site.getFeatures() : null; properties.put(SiteListener.SITE_LIST, toString(listFeatures, site.getList())); - properties.put(IRepository.PROP_SYSTEM, Boolean.TRUE.toString()); // deal with the metadata repository IMetadataRepository metadataRepository = null; |