Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autoupdate system must check org.openide.modules.arch as org.openide.modules.os is already handled #6477

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,14 @@ private void addElement (Map<String, UpdateUnit> impls, UpdateElement element, U

// XXX: it's should be moved in UI what should filter all elements w/ broken dependencies
// #101515: Plugin Manager must filter updates by platform dependency
boolean passed = false;
UpdateElementImpl elImpl = Trampoline.API.impl (element);
if (elImpl instanceof ModuleUpdateElementImpl && elImpl.getModuleInfos () != null && elImpl.getModuleInfos ().size() == 1) {
for (Dependency d : elImpl.getModuleInfos ().get (0).getDependencies ()) {
if (Dependency.TYPE_REQUIRES == d.getType ()) {
//log.log (Level.FINEST, "Dependency: NAME: " + d.getName () + ", TYPE: " + d.getType () + ": " + d.toString ());
if (d.getName ().startsWith ("org.openide.modules.os")) { // NOI18N
// Filter OS specific dependencies
boolean passed = false;
for (ModuleInfo info : InstalledModuleProvider.getInstalledModules ().values ()) {
if (Arrays.asList (info.getProvides ()).contains (d.getName ())) {
log.log (Level.FINEST, element + " which requires OS " + d + " succeed.");
Expand All @@ -235,6 +236,20 @@ private void addElement (Map<String, UpdateUnit> impls, UpdateElement element, U
log.log (Level.FINE, element + " which requires OS " + d + " fails.");
return ;
}
} else if (d.getName ().startsWith ("org.openide.modules.arch")) { // NOI18N
// Filter architecture specific dependencies
boolean passed = false;
for (ModuleInfo info : InstalledModuleProvider.getInstalledModules ().values ()) {
if (Arrays.asList (info.getProvides ()).contains (d.getName ())) {
log.log (Level.FINEST, element + " which requires architecture " + d + " succeed.");
passed = true;
break;
}
}
if (! passed) {
log.log (Level.FINE, element + " which requires architecture " + d + " fails.");
return ;
}
}
}
}
Expand Down