This is an automated email from the ASF dual-hosted git repository.

matthiasblaesing pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/netbeans.git


The following commit(s) were added to refs/heads/master by this push:
     new e46b0ea5e8 Autoupdate system must check org.openide.modules.arch as 
org.openide.modules.os is already handled
     new 0216ca48bb Merge pull request #6477 from 
matthiasblaesing/plugin_manager_architecture_dependency
e46b0ea5e8 is described below

commit e46b0ea5e8a8075bfd8caa47cd93a3f5e91e54ed
Author: Matthias Bläsing <mblaes...@doppel-helix.eu>
AuthorDate: Thu Sep 21 19:34:23 2023 +0200

    Autoupdate system must check org.openide.modules.arch as 
org.openide.modules.os is already handled
    
    With d1300be50b8864eb605cee456c4b123d768e0eca the netbeans module system
    was enhanced to enable modules to be filtered by architecture. Missing
    from that commit was adjustment to the autoupdate system, which also
    needs to consider the architecture when providing packages for
    selection.
    
    Closes: #6460
---
 .../modules/autoupdate/services/UpdateUnitFactory.java  | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git 
a/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/UpdateUnitFactory.java
 
b/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/UpdateUnitFactory.java
index 0b6a0a77f5..361f0cfd20 100644
--- 
a/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/UpdateUnitFactory.java
+++ 
b/platform/autoupdate.services/src/org/netbeans/modules/autoupdate/services/UpdateUnitFactory.java
@@ -217,13 +217,14 @@ public class UpdateUnitFactory {
         
         // 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.");
@@ -235,6 +236,20 @@ public class UpdateUnitFactory {
                             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 ;
+                        }
                     }
                 }
             }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@netbeans.apache.org
For additional commands, e-mail: commits-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to