Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Arthorne2010-03-05 15:42:43 -0500
committerJohn Arthorne2010-03-05 15:42:43 -0500
commit7d97d010680a6139742b9e78f3af74611ec0869f (patch)
tree7fe73a5ce69dbb045d14dd8cbb59464191532d6a
parent6dd835d615482635c0acec42c8e3f34e087ea3b4 (diff)
downloadrt.equinox.p2-7d97d010680a6139742b9e78f3af74611ec0869f.tar.gz
rt.equinox.p2-7d97d010680a6139742b9e78f3af74611ec0869f.tar.xz
rt.equinox.p2-7d97d010680a6139742b9e78f3af74611ec0869f.zip
Bug 266196 - [repo] flags used in getKnownRepositories(int) are confusing
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/internal/p2/repository/helpers/AbstractRepositoryManager.java2
-rw-r--r--bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepositoryManager.java33
2 files changed, 25 insertions, 10 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 0b3a29272..66e362f27 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
@@ -750,6 +750,8 @@ public abstract class AbstractRepositoryManager<T> implements IRepositoryManager
}
if ((flags & REPOSITORIES_LOCAL) == REPOSITORIES_LOCAL)
return "file".equals(info.location.getScheme()) || info.location.toString().startsWith("jar:file"); //$NON-NLS-1$ //$NON-NLS-2$
+ if ((flags & REPOSITORIES_NON_LOCAL) == REPOSITORIES_NON_LOCAL)
+ return !("file".equals(info.location.getScheme()) || info.location.toString().startsWith("jar:file")); //$NON-NLS-1$ //$NON-NLS-2$
return true;
}
diff --git a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepositoryManager.java b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepositoryManager.java
index a6501632f..908c1bc93 100644
--- a/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepositoryManager.java
+++ b/bundles/org.eclipse.equinox.p2.repository/src/org/eclipse/equinox/p2/repository/IRepositoryManager.java
@@ -35,30 +35,42 @@ public interface IRepositoryManager<T> extends IQueryable<T> {
public static final int REPOSITORIES_ALL = 0;
/**
- * Constant used to indicate that disabled repositories are of interest.
+ * Constant used to indicate that only system repositories are of interest.
+ * @see IRepository#PROP_SYSTEM
* @see #getKnownRepositories(int)
*/
- public static final int REPOSITORIES_DISABLED = 1 << 3;
+ public static final int REPOSITORIES_SYSTEM = 1 << 0;
+
+ /**
+ * Constant used to indicate that only non-system repositories are of interest.
+ * @see IRepository#PROP_SYSTEM
+ * @see #getKnownRepositories(int)
+ */
+ public static final int REPOSITORIES_NON_SYSTEM = 1 << 1;
/**
- * Constant used to indicate that local repositories are of interest.
+ * Constant used to indicate that only local repositories are of interest. Any
+ * repository that requires network communication will be omitted when
+ * this flag is used.
* @see #getKnownRepositories(int)
*/
public static final int REPOSITORIES_LOCAL = 1 << 2;
/**
- * Constant used to indicate that non-system repositories are of interest.
- * @see IRepository#PROP_SYSTEM
+ * Constant used to indicate that only remote repositories are of interest. Any
+ * repository that doesn't require network communication will be omitted when
+ * this flag is used.
* @see #getKnownRepositories(int)
*/
- public static final int REPOSITORIES_NON_SYSTEM = 1 << 1;
+ public static final int REPOSITORIES_NON_LOCAL = 1 << 4;
/**
- * Constant used to indicate that system repositories are of interest.
- * @see IRepository#PROP_SYSTEM
+ * Constant used to indicate that only disabled repositories are of interest.
+ * When this flag is used, all enabled repositories will be ignored and
+ * all disabled repositories that match the remaining filters will be returned.
* @see #getKnownRepositories(int)
*/
- public static final int REPOSITORIES_SYSTEM = 1 << 0;
+ public static final int REPOSITORIES_DISABLED = 1 << 3;
/**
* Constant used to indicate that a repository manager should only load the
@@ -108,7 +120,8 @@ public interface IRepositoryManager<T> extends IQueryable<T> {
*
* @param flags an integer bit-mask indicating which repositories should be
* returned. <code>REPOSITORIES_ALL</code> can be used as the mask when
- * all enabled repositories should be returned.
+ * all enabled repositories should be returned. Disabled repositories are automatically
+ * excluded unless the {@link #REPOSITORIES_DISABLED} flag is set.
* @return the locations of the repositories managed by this repository manager.
*
* @see #REPOSITORIES_ALL

Back to the top