code: public static Map<String, List<String>> buildDepsForModulelist(
          List<String> moduleNames,
          String rfsAbsPath,
          boolean mode)
      throws CmsConfigurationException {
  
          Map<String, List<String>> ret = buildDepsForAllModules(rfsAbsPath, mode);
          Iterator<CmsModule> itMods;
          if (rfsAbsPath == null) {
              itMods = OpenCms.getModuleManager().getAllInstalledModules().iterator();
          } else {
              itMods = getAllModulesFromPath(rfsAbsPath).keySet().iterator();
          }
          while (itMods.hasNext()) {
              CmsModule module = itMods.next();
              if (!moduleNames.contains(module.getName())) {
                  Iterator<List<String>> itDeps = ret.values().iterator();
                  while (itDeps.hasNext()) {
                      List<String> dependencies = itDeps.next();
                      dependencies.remove(module.getName());
                  }
                  ret.remove(module.getName());
              }
          }
          return ret;
      }
docs: Returns a map of dependencies between the given modules.<p>
  
  The module dependencies are get from the installed modules or
  from the module manifest.xml files found in the given FRS path.<p>
  
  Two types of dependency lists can be generated:<br>
  <ul>
  <li>Forward dependency lists: a list of modules that depends on a module</li>
  <li>Backward dependency lists: a list of modules that a module depends on</li>
  </ul>
  
  @param moduleNames a list of module names
  @param rfsAbsPath a RFS absolute path to search for modules, or <code>null</code> to use the installed modules
  @param mode if <code>true</code> a list of forward dependency is build, is not a list of backward dependency
  
  @return a Map of module names as keys and a list of dependency names as values
  
  @throws CmsConfigurationException if something goes wrong