415826 start.jar module --enable and --disable

This commit is contained in:
Greg Wilkins 2013-08-27 13:38:42 +10:00
parent ea21a1798a
commit 302ffe4ff1
2 changed files with 15 additions and 12 deletions

View File

@ -704,9 +704,9 @@ public class Main
// Process dependencies
Modules modules = args.getAllModules();
Module module=modules.get(name);
for (String parent:module.getParentNames())
enable(args,parent,false);
if (module!=null)
for (String parent:module.getParentNames())
enable(args,parent,false);
}
private void disable(StartArgs args, String name, boolean verbose) throws IOException

View File

@ -103,7 +103,12 @@ public class Modules implements Iterable<Module>
for (String parentName : module.getParentNames())
{
Module parent = get(parentName);
if (parent != null)
if (parent == null)
{
System.err.printf("WARNING: module not found [%s]%n",parentName);
}
else
{
module.addParentEdge(parent);
parent.addChildEdge(module);
@ -113,8 +118,11 @@ public class Modules implements Iterable<Module>
for (String optionalParentName : module.getOptionalParentNames())
{
Module optional = get(optionalParentName);
if ((optional != null) && optional.isEnabled())
if (optional==null)
{
System.err.printf("WARNING: module not found [%s]%n",optionalParentName);
}
else if (optional.isEnabled())
{
module.addParentEdge(optional);
optional.addChildEdge(module);
@ -301,12 +309,7 @@ public class Modules implements Iterable<Module>
public Module get(String name)
{
Module module = modules.get(name);
if (module == null)
{
System.err.printf("WARNING: module not found [%s]%n",name);
}
return module;
return modules.get(name);
}
@Override