Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSusan McCourt2014-04-14 04:25:28 -0400
committerSusan McCourt2014-04-14 04:25:28 -0400
commit203823e336649d1ca4f21165f09e30ef7f43418e (patch)
tree3b4bda153dc0436956d81a0d890411403a4c3b60
parentf2f5b0275d4f2724da924ba67932b47004b1e101 (diff)
downloadrt.equinox.p2-203823e336649d1ca4f21165f09e30ef7f43418e.tar.gz
rt.equinox.p2-203823e336649d1ca4f21165f09e30ef7f43418e.tar.xz
rt.equinox.p2-203823e336649d1ca4f21165f09e30ef7f43418e.zip
Bug 432634 - [Product][Editors] Add support for p2 repoI20140415-0800
Remove API changes from IConfigAdvice Change-Id: I4ae827621752f41f0e983ba5cbeb4622bad1073a
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigAdvice.java8
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigCUsAction.java18
-rw-r--r--bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/IConfigAdvice.java3
3 files changed, 11 insertions, 18 deletions
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigAdvice.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigAdvice.java
index d01e30fdc..446d70d0c 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigAdvice.java
@@ -10,12 +10,11 @@
******************************************************************************/
package org.eclipse.equinox.p2.publisher.eclipse;
-import java.util.*;
+import java.util.Map;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
import org.eclipse.equinox.internal.provisional.frameworkadmin.ConfigData;
import org.eclipse.equinox.p2.publisher.AbstractAdvice;
-import org.eclipse.equinox.p2.repository.IRepositoryReference;
public class ConfigAdvice extends AbstractAdvice implements IConfigAdvice {
@@ -40,9 +39,4 @@ public class ConfigAdvice extends AbstractAdvice implements IConfigAdvice {
return CollectionUtils.toMap(data.getProperties());
}
- public List<IRepositoryReference> getUpdateRepositories() {
- // The config data does not carry repository info so we return an empty list
- return new ArrayList<IRepositoryReference>();
- }
-
}
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigCUsAction.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigCUsAction.java
index 6a8bcc54b..c1ca73001 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigCUsAction.java
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/ConfigCUsAction.java
@@ -259,14 +259,16 @@ public class ConfigCUsAction extends AbstractPublisherAction {
unconfigurationData += TouchpointInstruction.encodeAction("setProgramProperty", parameters); //$NON-NLS-1$
}
}
- for (IRepositoryReference repo : advice.getUpdateRepositories()) {
- Map<String, String> parameters = new LinkedHashMap<String, String>();
- parameters.put("type", Integer.toString(repo.getType())); //$NON-NLS-1$
- parameters.put("location", repo.getLocation().toString()); //$NON-NLS-1$
- parameters.put("enabled", Boolean.toString((repo.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); //$NON-NLS-1$
- configurationData += TouchpointInstruction.encodeAction("addRepository", parameters); //$NON-NLS-1$
- parameters.remove("enabled"); //$NON-NLS-1$
- unconfigurationData += TouchpointInstruction.encodeAction("removeRepository", parameters);//$NON-NLS-1$
+ if (advice instanceof ProductFileAdvice) {
+ for (IRepositoryReference repo : ((ProductFileAdvice) advice).getUpdateRepositories()) {
+ Map<String, String> parameters = new LinkedHashMap<String, String>();
+ parameters.put("type", Integer.toString(repo.getType())); //$NON-NLS-1$
+ parameters.put("location", repo.getLocation().toString()); //$NON-NLS-1$
+ parameters.put("enabled", Boolean.toString((repo.getOptions() & IRepository.ENABLED) == IRepository.ENABLED)); //$NON-NLS-1$
+ configurationData += TouchpointInstruction.encodeAction("addRepository", parameters); //$NON-NLS-1$
+ parameters.remove("enabled"); //$NON-NLS-1$
+ unconfigurationData += TouchpointInstruction.encodeAction("removeRepository", parameters);//$NON-NLS-1$
+ }
}
}
return new String[] {configurationData, unconfigurationData};
diff --git a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/IConfigAdvice.java b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/IConfigAdvice.java
index 6c5ef15d2..7e65ab692 100644
--- a/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/IConfigAdvice.java
+++ b/bundles/org.eclipse.equinox.p2.publisher.eclipse/src/org/eclipse/equinox/p2/publisher/eclipse/IConfigAdvice.java
@@ -10,11 +10,9 @@
******************************************************************************/
package org.eclipse.equinox.p2.publisher.eclipse;
-import java.util.List;
import java.util.Map;
import org.eclipse.equinox.frameworkadmin.BundleInfo;
import org.eclipse.equinox.p2.publisher.IPublisherAdvice;
-import org.eclipse.equinox.p2.repository.IRepositoryReference;
public interface IConfigAdvice extends IPublisherAdvice {
@@ -22,5 +20,4 @@ public interface IConfigAdvice extends IPublisherAdvice {
public Map<String, String> getProperties();
- public List<IRepositoryReference> getUpdateRepositories();
}

Back to the top