diff options
author | DJ Houghton | 2008-04-22 23:50:13 +0000 |
---|---|---|
committer | DJ Houghton | 2008-04-22 23:50:13 +0000 |
commit | 6312485fe57eedfcd84789d5e45394bce73511f3 (patch) | |
tree | 3b3b27d3ea983508460f61faf7734ca46d6b4cf9 | |
parent | b93e4c7796d9abdf274934eb2579637ac83d3b61 (diff) | |
download | rt.equinox.p2-6312485fe57eedfcd84789d5e45394bce73511f3.tar.gz rt.equinox.p2-6312485fe57eedfcd84789d5e45394bce73511f3.tar.xz rt.equinox.p2-6312485fe57eedfcd84789d5e45394bce73511f3.zip |
Bug 222567 - Site policy filtering code needs to move to the extension location repositories
11 files changed, 273 insertions, 29 deletions
diff --git a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF index d7933ae58..699b937fb 100644 --- a/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.core/META-INF/MANIFEST.MF @@ -41,7 +41,8 @@ Export-Package: org.eclipse.equinox.internal.p2.core;x-friends:="org.eclipse.equ org.eclipse.equinox.p2.garbagecollector, org.eclipse.equinox.p2.console, org.eclipse.equinox.p2.updatesite, - org.eclipse.equinox.p2.reconciler.dropins", + org.eclipse.equinox.p2.reconciler.dropins, + org.eclipse.equinox.p2.extensionlocation", org.eclipse.equinox.internal.p2.persistence;x-friends:="org.eclipse.equinox.p2.artifact.repository,org.eclipse.equinox.p2.engine,org.eclipse.equinox.p2.metadata.repository", org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.eventbus, diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF index c24c43e4a..dc1c4fc3c 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/META-INF/MANIFEST.MF @@ -8,19 +8,24 @@ Bundle-SymbolicName: org.eclipse.equinox.p2.extensionlocation;singleton:=true Bundle-Activator: org.eclipse.equinox.internal.p2.extensionlocation.Activator Bundle-RequiredExecutionEnvironment: J2SE-1.4, CDC-1.1/Foundation-1.1 -Export-Package: org.eclipse.equinox.internal.p2.extensionlocation;x-internal:=true -Import-Package: org.eclipse.equinox.internal.p2.touchpoint.eclipse, +Export-Package: org.eclipse.equinox.internal.p2.extensionlocation;x-friends:="org.eclipse.equinox.p2.reconciler.dropins" +Import-Package: org.eclipse.equinox.internal.p2.core.helpers, + org.eclipse.equinox.internal.p2.metadata.generator.features, + org.eclipse.equinox.internal.p2.touchpoint.eclipse, + org.eclipse.equinox.internal.p2.update, org.eclipse.equinox.internal.provisional.p2.artifact.repository, org.eclipse.equinox.internal.provisional.p2.core, org.eclipse.equinox.internal.provisional.p2.core.repository, org.eclipse.equinox.internal.provisional.p2.directorywatcher, org.eclipse.equinox.internal.provisional.p2.engine, org.eclipse.equinox.internal.provisional.p2.metadata, + org.eclipse.equinox.internal.provisional.p2.metadata.generator, org.eclipse.equinox.internal.provisional.p2.metadata.repository, org.eclipse.equinox.internal.provisional.p2.query, org.eclipse.equinox.internal.provisional.spi.p2.artifact.repository, org.eclipse.equinox.internal.provisional.spi.p2.core.repository, org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository, + org.eclipse.osgi.service.resolver;version="1.2.0", org.eclipse.osgi.util, org.osgi.framework Require-Bundle: org.eclipse.equinox.common;bundle-version="3.4.0" diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java index fc381dc8d..973d5f055 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepository.java @@ -15,6 +15,7 @@ import java.net.MalformedURLException; import java.net.URL; import java.util.Map; import org.eclipse.core.runtime.*; +import org.eclipse.equinox.internal.p2.update.Site; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.*; import org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit; @@ -34,7 +35,7 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit private static final String FILE = "file"; //$NON-NLS-1$ private final IMetadataRepository metadataRepository; - public ExtensionLocationMetadataRepository(URL location, IProgressMonitor monitor) throws ProvisionException { + public ExtensionLocationMetadataRepository(URL location, Site site, IProgressMonitor monitor) throws ProvisionException { super("Extension: " + location.toExternalForm(), null, null, location, null, null, null); //$NON-NLS-1$ File base = getBaseDirectory(location); @@ -59,6 +60,9 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit DirectoryChangeListener listener = new RepositoryListener(context, metadataRepository, null); if (location.getPath().endsWith(POOLED)) listener = new BundlePoolFilteredListener(listener); + // TODO + // if (site != null) + // listener = new SiteListener(site, listener); watcher.addListener(listener); watcher.poll(); @@ -74,18 +78,30 @@ public class ExtensionLocationMetadataRepository extends AbstractMetadataReposit return factory.create(stateDirURL, repositoryName, null, null); } + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository#addInstallableUnits(org.eclipse.equinox.internal.provisional.p2.metadata.IInstallableUnit[]) + */ public void addInstallableUnits(IInstallableUnit[] installableUnits) { throw new UnsupportedOperationException(); } + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository#removeAll() + */ public void removeAll() { throw new UnsupportedOperationException(); } + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.metadata.repository.IMetadataRepository#removeInstallableUnits(org.eclipse.equinox.internal.provisional.p2.query.Query, org.eclipse.core.runtime.IProgressMonitor) + */ public boolean removeInstallableUnits(Query query, IProgressMonitor monitor) { throw new UnsupportedOperationException(); } + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.query.IQueryable#query(org.eclipse.equinox.internal.provisional.p2.query.Query, org.eclipse.equinox.internal.provisional.p2.query.Collector, org.eclipse.core.runtime.IProgressMonitor) + */ public Collector query(Query query, Collector collector, IProgressMonitor monitor) { return metadataRepository.query(query, collector, monitor); } diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java index c706a8ab8..29bc8390a 100644 --- a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/ExtensionLocationMetadataRepositoryFactory.java @@ -23,10 +23,16 @@ public class ExtensionLocationMetadataRepositoryFactory implements IMetadataRepo return null; } + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.IMetadataRepositoryFactory#load(java.net.URL, org.eclipse.core.runtime.IProgressMonitor) + */ public IMetadataRepository load(URL location, IProgressMonitor monitor) throws ProvisionException { - return new ExtensionLocationMetadataRepository(location, monitor); + return new ExtensionLocationMetadataRepository(location, null, monitor); } + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.spi.p2.metadata.repository.IMetadataRepositoryFactory#validate(java.net.URL, org.eclipse.core.runtime.IProgressMonitor) + */ public IStatus validate(URL location, IProgressMonitor monitor) { try { ExtensionLocationMetadataRepository.validate(location, monitor); diff --git a/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java new file mode 100644 index 000000000..7b85b0e0c --- /dev/null +++ b/bundles/org.eclipse.equinox.p2.extensionlocation/src/org/eclipse/equinox/internal/p2/extensionlocation/SiteListener.java @@ -0,0 +1,210 @@ +/******************************************************************************* + * Copyright (c) 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ +package org.eclipse.equinox.internal.p2.extensionlocation; + +import java.io.File; +import java.net.MalformedURLException; +import java.net.URL; +import java.util.*; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; +import org.eclipse.equinox.internal.p2.core.helpers.URLUtil; +import org.eclipse.equinox.internal.p2.metadata.generator.features.FeatureParser; +import org.eclipse.equinox.internal.p2.update.Site; +import org.eclipse.equinox.internal.provisional.p2.directorywatcher.*; +import org.eclipse.equinox.internal.provisional.p2.directorywatcher.Messages; +import org.eclipse.equinox.internal.provisional.p2.metadata.generator.*; +import org.eclipse.osgi.service.resolver.*; +import org.osgi.framework.ServiceReference; + +/** + * @since 1.0 + */ +public class SiteListener extends RepositoryListener { + + private static final String FEATURES = "features"; //$NON-NLS-1$ + private static final String PLUGINS = "plugins"; //$NON-NLS-1$ + private DirectoryChangeListener delegate; + private Site site; + private String[] managedFiles; + + /* + * Return true if the given list contains the full path of the given file + * handle. Return false otherwise. + */ + private static boolean contains(String[] plugins, File file) { + String filename = file.getAbsolutePath(); + for (int i = 0; i < plugins.length; i++) + if (filename.endsWith(new File(plugins[i]).toString())) + return true; + return false; + } + + /* + * Create a new site listener on the given site. + */ + public SiteListener(Site site, DirectoryChangeListener delegate) { + super(Activator.getContext(), site.getUrl()); + this.delegate = delegate; + this.site = site; + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener#isInterested(java.io.File) + */ + public boolean isInterested(File file) { + // make sure that our delegate and super-class are both interested in + // the file before we consider it + if (!delegate.isInterested(file) || !super.isInterested(file)) + return false; + String policy = site.getPolicy(); + String[] plugins = site.getList(); + if (Site.POLICY_MANAGED_ONLY.equals(policy)) { + // we only want plug-ins referenced by features + return contains(getManagedFiles(), file); + } else if (Site.POLICY_USER_EXCLUDE.equals(policy)) { + // ensure the file doesn't refer to a plug-in in our list + return plugins.length == 0 ? true : !contains(plugins, file); + } else if (Site.POLICY_USER_INCLUDE.equals(policy)) { + // we are only interested in plug-ins in the list + return plugins.length == 0 ? false : contains(plugins, file); + } + return false; + } + + /* + * Return an array of files which are managed. This includes all of the features + * for this site, as well as the locations for all the plug-ins referenced by those + * features. + */ + private String[] getManagedFiles() { + if (managedFiles != null) + return managedFiles; + List result = new ArrayList(); + File siteLocation; + try { + siteLocation = URLUtil.toFile(new URL(site.getUrl())); + } catch (MalformedURLException e) { + LogHelper.log(new Status(IStatus.ERROR, Activator.ID, "Unable to create a URL from site locatin: " + site.getUrl(), e)); + return new String[0]; + } + Map pluginCache = getPlugins(siteLocation); + Map featureCache = getFeatures(siteLocation); + for (Iterator iter = featureCache.keySet().iterator(); iter.hasNext();) { + File featureFile = (File) iter.next(); + // add the feature path + result.add(featureFile.toString()); + org.eclipse.equinox.internal.provisional.p2.metadata.generator.Feature feature = (org.eclipse.equinox.internal.provisional.p2.metadata.generator.Feature) featureCache.get(featureFile); + FeatureEntry[] entries = feature.getEntries(); + for (int inner = 0; inner < entries.length; inner++) { + FeatureEntry entry = entries[inner]; + // grab the right location from the plug-in cache + String key = entry.getId() + '/' + entry.getVersion(); + File pluginLocation = (File) pluginCache.get(key); + if (pluginLocation != null) + result.add(pluginLocation.toString()); + } + } + managedFiles = (String[]) result.toArray(new String[result.size()]); + return managedFiles; + } + + /* + * Iterate over the feature directory and return a map of + * File to Feature objects (from the generator bundle) + */ + private Map getFeatures(File siteLocation) { + Map result = new HashMap(); + File featureDir = new File(siteLocation, FEATURES); + File[] children = featureDir.listFiles(); + for (int i = 0; i < children.length; i++) { + File child = children[i]; + FeatureParser parser = new FeatureParser(); + Feature entry = parser.parse(child); + if (entry != null) + result.put(child, entry); + } + return result; + } + + /* + * Iterate over the plugins directory and return a map of + * plug-in id/version to File locations. + */ + private Map getPlugins(File siteLocation) { + ServiceReference reference = Activator.getContext().getServiceReference(PlatformAdmin.class.getName()); + if (reference == null) + throw new IllegalStateException(Messages.platformadmin_not_registered); + try { + PlatformAdmin platformAdmin = (PlatformAdmin) Activator.getContext().getService(reference); + if (platformAdmin == null) + throw new IllegalStateException(Messages.platformadmin_not_registered); + StateObjectFactory stateObjectFactory = platformAdmin.getFactory(); + BundleDescriptionFactory factory = new BundleDescriptionFactory(stateObjectFactory, null); + File[] plugins = new File(siteLocation, PLUGINS).listFiles(); + Map result = new HashMap(); + for (int i = 0; plugins != null && i < plugins.length; i++) { + File bundleLocation = plugins[i]; + BundleDescription description = factory.getBundleDescription(bundleLocation); + String id = description.getSymbolicName(); + String version = description.getVersion().toString(); + result.put(id + '/' + version, bundleLocation); + } + return result; + } finally { + Activator.getContext().ungetService(reference); + } + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#added(java.io.File) + */ + public boolean added(File file) { + return delegate.added(file); + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#changed(java.io.File) + */ + public boolean changed(File file) { + return delegate.changed(file); + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#getSeenFile(java.io.File) + */ + public Long getSeenFile(File file) { + return delegate.getSeenFile(file); + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#removed(java.io.File) + */ + public boolean removed(File file) { + return delegate.removed(file); + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#startPoll() + */ + public void startPoll() { + delegate.startPoll(); + } + + /* (non-Javadoc) + * @see org.eclipse.equinox.internal.provisional.p2.directorywatcher.RepositoryListener#stopPoll() + */ + public void stopPoll() { + delegate.stopPoll(); + } + +} diff --git a/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF index 58fc84207..e79cf5a9f 100644 --- a/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.metadata.generator/META-INF/MANIFEST.MF @@ -25,7 +25,7 @@ Import-Package: javax.xml.parsers, org.xml.sax.helpers Bundle-Activator: org.eclipse.equinox.internal.p2.metadata.generator.Activator Export-Package: org.eclipse.equinox.internal.p2.metadata.generator;x-internal:=true, - org.eclipse.equinox.internal.p2.metadata.generator.features;x-friends:="org.eclipse.equinox.p2.updatesite, org.eclipse.equinox.p2.directorywatcher", + org.eclipse.equinox.internal.p2.metadata.generator.features;x-friends:="org.eclipse.equinox.p2.updatesite,org.eclipse.equinox.p2.directorywatcher,org.eclipse.equinox.p2.extensionlocation", org.eclipse.equinox.internal.provisional.p2.metadata.generator Bundle-ActivationPolicy: lazy Bundle-RequiredExecutionEnvironment: J2SE-1.4 diff --git a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF index bf78a29ee..afdab1075 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.reconciler.dropins/META-INF/MANIFEST.MF @@ -9,6 +9,7 @@ Bundle-Activator: org.eclipse.equinox.internal.p2.reconciler.dropins.Activator Bundle-RequiredExecutionEnvironment: J2SE-1.4, CDC-1.1/Foundation-1.1 Import-Package: org.eclipse.equinox.internal.p2.core.helpers, + org.eclipse.equinox.internal.p2.extensionlocation, org.eclipse.equinox.internal.p2.update, org.eclipse.equinox.internal.provisional.configurator, org.eclipse.equinox.internal.provisional.p2.artifact.repository, 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 e11924ae9..cb5e41c19 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 @@ -1,13 +1,13 @@ /******************************************************************************* -* Copyright (c) 2007, 2008 IBM Corporation and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* IBM Corporation - initial API and implementation -*******************************************************************************/ + * Copyright (c) 2007, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ package org.eclipse.equinox.internal.p2.reconciler.dropins; import java.io.File; @@ -17,6 +17,7 @@ import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepository; import org.eclipse.equinox.internal.p2.update.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener; @@ -139,7 +140,8 @@ public class PlatformXmlListener extends DirectoryChangeListener { List sites = config.getSites(); Set newRepos = new LinkedHashSet(); for (Iterator iter = sites.iterator(); iter.hasNext();) { - String siteURL = ((Site) iter.next()).getUrl(); + Site site = (Site) iter.next(); + String siteURL = site.getUrl(); // TODO: this is our way of skipping the base. // we will need to change this to platform:/base/ at some point if ("file:.".equals(siteURL) || "file:".equals(siteURL)) //$NON-NLS-1$//$NON-NLS-2$ @@ -152,7 +154,7 @@ public class PlatformXmlListener extends DirectoryChangeListener { if (match == null) { try { URL repoURL = new URL(siteURL); - IMetadataRepository newRepo = Activator.loadMetadataRepository(repoURL); + IMetadataRepository newRepo = new ExtensionLocationMetadataRepository(repoURL, site, null); Activator.loadArtifactRepository(repoURL); newRepos.add(newRepo); } catch (MalformedURLException e) { diff --git a/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF index bf78a29ee..afdab1075 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.reconciler/META-INF/MANIFEST.MF @@ -9,6 +9,7 @@ Bundle-Activator: org.eclipse.equinox.internal.p2.reconciler.dropins.Activator Bundle-RequiredExecutionEnvironment: J2SE-1.4, CDC-1.1/Foundation-1.1 Import-Package: org.eclipse.equinox.internal.p2.core.helpers, + org.eclipse.equinox.internal.p2.extensionlocation, org.eclipse.equinox.internal.p2.update, org.eclipse.equinox.internal.provisional.configurator, org.eclipse.equinox.internal.provisional.p2.artifact.repository, diff --git a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java index e11924ae9..cb5e41c19 100644 --- a/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java +++ b/bundles/org.eclipse.equinox.p2.reconciler/src/org/eclipse/equinox/internal/p2/reconciler/dropins/PlatformXmlListener.java @@ -1,13 +1,13 @@ /******************************************************************************* -* Copyright (c) 2007, 2008 IBM Corporation and others. -* All rights reserved. This program and the accompanying materials -* are made available under the terms of the Eclipse Public License v1.0 -* which accompanies this distribution, and is available at -* http://www.eclipse.org/legal/epl-v10.html -* -* Contributors: -* IBM Corporation - initial API and implementation -*******************************************************************************/ + * Copyright (c) 2007, 2008 IBM Corporation and others. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * IBM Corporation - initial API and implementation + *******************************************************************************/ package org.eclipse.equinox.internal.p2.reconciler.dropins; import java.io.File; @@ -17,6 +17,7 @@ import java.util.*; import org.eclipse.core.runtime.*; import org.eclipse.equinox.internal.p2.core.helpers.LogHelper; import org.eclipse.equinox.internal.p2.core.helpers.ServiceHelper; +import org.eclipse.equinox.internal.p2.extensionlocation.ExtensionLocationMetadataRepository; import org.eclipse.equinox.internal.p2.update.*; import org.eclipse.equinox.internal.provisional.p2.core.ProvisionException; import org.eclipse.equinox.internal.provisional.p2.directorywatcher.DirectoryChangeListener; @@ -139,7 +140,8 @@ public class PlatformXmlListener extends DirectoryChangeListener { List sites = config.getSites(); Set newRepos = new LinkedHashSet(); for (Iterator iter = sites.iterator(); iter.hasNext();) { - String siteURL = ((Site) iter.next()).getUrl(); + Site site = (Site) iter.next(); + String siteURL = site.getUrl(); // TODO: this is our way of skipping the base. // we will need to change this to platform:/base/ at some point if ("file:.".equals(siteURL) || "file:".equals(siteURL)) //$NON-NLS-1$//$NON-NLS-2$ @@ -152,7 +154,7 @@ public class PlatformXmlListener extends DirectoryChangeListener { if (match == null) { try { URL repoURL = new URL(siteURL); - IMetadataRepository newRepo = Activator.loadMetadataRepository(repoURL); + IMetadataRepository newRepo = new ExtensionLocationMetadataRepository(repoURL, site, null); Activator.loadArtifactRepository(repoURL); newRepos.add(newRepo); } catch (MalformedURLException e) { diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF index 05868db52..a2d3b95c0 100644 --- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF +++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/META-INF/MANIFEST.MF @@ -32,7 +32,7 @@ Import-Package: javax.xml.parsers, org.xml.sax Export-Package: org.eclipse.equinox.internal.p2.touchpoint.eclipse;x-friends:="org.eclipse.equinox.p2.reconciler.dropins,org.eclipse.equinox.p2.extensionlocation", org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions;x-internal:=true, - org.eclipse.equinox.internal.p2.update;x-friends:="org.eclipse.equinox.p2.reconciler.dropins" + org.eclipse.equinox.internal.p2.update;x-friends:="org.eclipse.equinox.p2.reconciler.dropins,org.eclipse.equinox.p2.extensionlocation" Bundle-RequiredExecutionEnvironment: J2SE-1.4, CDC-1.1/Foundation-1.1 Bundle-ActivationPolicy: lazy |