1 Star 0 Fork 28

宋立洋/eclipse

forked from src-openEuler/eclipse 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
eclipse-hide-droplets-from-install-wizard.patch 3.28 KB
一键复制 编辑 原始数据 按行查看 历史
sigui 提交于 2020-03-12 21:48 +08:00 . Package Init.
commit 4bfc5a7c6d8c2aaf954c113d805419472de2bcaf
Author: Mat Booth <mat.booth@redhat.com>
Date: Thu May 3 15:58:49 2018 +0100
Bug 534326 - Awkward p2 UI when many droplets are installed
Filter out software site locations where we know that they are p2
droplets in places we show the list to the user.
Change-Id: I12364223850862783cb7cffd32fb7428fbf6b270
Signed-off-by: Mat Booth <mat.booth@redhat.com>
diff --git a/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java b/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
index e6eef8c39..fe5970e79 100644
--- a/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
+++ b/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/internal/p2/ui/dialogs/RepositorySelectionGroup.java
@@ -300,6 +300,19 @@ public class RepositorySelectionGroup {
void fillRepoCombo(final String selection) {
RepositoryTracker tracker = ui.getRepositoryTracker();
URI[] sites = tracker.getKnownRepositories(ui.getSession());
+ // Filter out sites that are actually installed p2 droplets
+ String fragments = System.getProperty("p2.fragments"); //$NON-NLS-1$
+ ArrayList<URI> filteredSites = new ArrayList<>(Arrays.asList(sites));
+ if (fragments != null) {
+ for (String root : fragments.split(",")) { //$NON-NLS-1$
+ for (URI uri : sites) {
+ if (uri.getPath() != null && uri.getPath().startsWith(root)) {
+ filteredSites.remove(uri);
+ }
+ }
+ }
+ }
+ sites = filteredSites.toArray(new URI[0]);
boolean hasLocalSites = getLocalSites().length > 0;
final String[] items;
if (hasLocalSites) {
diff --git a/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java b/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
index d796aefd0..c03924f90 100644
--- a/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
+++ b/rt.equinox.p2/bundles/org.eclipse.equinox.p2.ui/src/org/eclipse/equinox/p2/ui/RepositoryManipulationPage.java
@@ -130,9 +130,22 @@ public class RepositoryManipulationPage extends PreferencePage implements IWorkb
if (cachedElements == null) {
Object[] children = super.fetchChildren(o, monitor);
cachedElements = new Hashtable<>(children.length);
+ String fragments = System.getProperty("p2.fragments"); //$NON-NLS-1$
for (int i = 0; i < children.length; i++) {
if (children[i] instanceof MetadataRepositoryElement) {
- put((MetadataRepositoryElement) children[i]);
+ // Filter out locations that are actually installed p2 droplets
+ if (fragments != null) {
+ boolean isDroplet = false;
+ for (String root : fragments.split(",")) { //$NON-NLS-1$
+ URI childLoc = ((MetadataRepositoryElement) children[i]).getLocation();
+ if (childLoc.getPath() != null && childLoc.getPath().startsWith(root)) {
+ isDroplet = true;
+ }
+ }
+ if (!isDroplet) {
+ put((MetadataRepositoryElement) children[i]);
+ }
+ }
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/sworn/eclipse.git
git@gitee.com:sworn/eclipse.git
sworn
eclipse
eclipse
master

搜索帮助