Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rapicault (Ericsson)2012-09-13 11:56:58 -0400
committerPascal Rapicault2012-11-16 22:43:24 -0500
commit74e7bfd3f06c6a8dc1501a60a244babbcc6af73c (patch)
tree5929a3dc9b3584a79d468fc8eab946cedf53753d /bundles/org.eclipse.equinox.p2.repository
parentd709ac369fb457887ecb709a3680da983bb9d9cc (diff)
downloadrt.equinox.p2-74e7bfd3f06c6a8dc1501a60a244babbcc6af73c.tar.gz
rt.equinox.p2-74e7bfd3f06c6a8dc1501a60a244babbcc6af73c.tar.xz
rt.equinox.p2-74e7bfd3f06c6a8dc1501a60a244babbcc6af73c.zip
Bug 249133 - [shared] Default update site list blank in shared install
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.repository')
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java25
1 files changed, 21 insertions, 4 deletions
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
index 207eebcee..537e1c308 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java
@@ -9,6 +9,7 @@
* IBM Corporation - initial API and implementation
* Wind River - fix for bug 299227
* Sonatype, Inc. - transport split
+ * Red Hat,Inc. - fix for bug 249133
*******************************************************************************/
package org.eclipse.equinox.internal.p2.repository.helpers;
@@ -504,6 +505,21 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
}
}
+ Preferences getSharedPreferences() {
+ if (agentLocation == null)
+ return null;
+ IPreferencesService prefService = (IPreferencesService) ServiceHelper.getService(Activator.getContext(), IPreferencesService.class.getName());
+ if (prefService == null)
+ return null;
+ try {
+ //see ProfileScope for preference path format
+ String locationString = EncodingUtils.encodeSlashes(agentLocation.getRootLocation().toString());
+ return prefService.getRootNode().node("/profile/shared/" + locationString + "/_SELF_/" + getBundleId() + '/' + NODE_REPOSITORIES); //$NON-NLS-1$ //$NON-NLS-2$
+ } catch (IllegalArgumentException e) {
+ return null;
+ }
+ }
+
/**
* Restores a repository location from the preferences.
*/
@@ -944,9 +960,8 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
/*
* Load the list of repositories from the preferences.
*/
- private void restoreFromPreferences() {
+ private void basicRestoreFromPreferences(Preferences node, boolean save) {
// restore the list of repositories from the preference store
- Preferences node = getPreferences();
if (node == null)
return;
String[] children;
@@ -978,7 +993,8 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
repositories.put(getKey(info.location), info);
}
// now that we have loaded everything, remember them
- saveToPreferences();
+ if (save)
+ saveToPreferences();
}
private void restoreFromSystemProperty() {
@@ -1003,7 +1019,8 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
repositories = new HashMap<String, RepositoryInfo<T>>();
restoreSpecialRepositories();
restoreFromSystemProperty();
- restoreFromPreferences();
+ basicRestoreFromPreferences(getSharedPreferences(), false);
+ basicRestoreFromPreferences(getPreferences(), true);
}
}

Back to the top