eclipse/eclipse-drop-user-profile-on-platform-change.patch
2012-08-02 11:49:57 +02:00

33 lines
1.6 KiB
Diff

--- rt.equinox.p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java
+++ rt.equinox.p2/bundles/org.eclipse.equinox.simpleconfigurator/src/org/eclipse/equinox/internal/simpleconfigurator/SimpleConfiguratorImpl.java
@@ -100,7 +100,10 @@
URL userConfigURL = userConfig.toURL();
List userBundles = SimpleConfiguratorUtils.readConfiguration(userConfigURL, base);
- return (userBundles.containsAll(sharedBundles)) ? userConfigURL : sharedConfigURL;
+ boolean useUserConfigArea = userBundles.containsAll(sharedBundles);
+ System.setProperty("org.eclipse.equinox.simpleconfigurator.shared.useUser", "" + System.currentTimeMillis());
+
+ return useUserConfigArea ? userConfigURL : sharedConfigURL;
}
} catch (MalformedURLException e) {
return null;
--- rt.equinox.p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
+++ rt.equinox.p2/bundles/org.eclipse.equinox.p2.engine/src/org/eclipse/equinox/internal/p2/engine/SimpleProfileRegistry.java
@@ -236,8 +236,14 @@
if (SELF.equals(id))
id = self;
Profile profile = getProfileMap().get(id);
- if (profile == null && self != null && self.equals(id))
+ String s = System.getProperty("org.eclipse.equinox.simpleconfigurator.shared.useUser");
+ if (s != null && profile != null && (profile.getTimestamp() < new Long(s))) {
+ profile = null;
+ }
+ if (profile == null && self != null && self.equals(id)) {
profile = createSurrogateProfile(id);
+
+ }
return profile;
}