fixes: ~
changes:
- improve French translation (pr-176)
+ - simplify current plugin release detection and ignore the currentRelease registry field
additions: ~
dependencyChanges:
- update to Apache MINA/SSHD 0.11.0 (issue-410)
List<PluginRegistration> list = getRegisteredPlugins();
Iterator<PluginRegistration> itr = list.iterator();
while (itr.hasNext()) {
- if (state != itr.next().getInstallState()) {
+ if (state != itr.next().getInstallState(getSystemVersion())) {
itr.remove();
}
}
\r
public String projectUrl;\r
\r
- public String currentRelease;\r
-\r
public transient String installedRelease;\r
\r
public transient String registry;\r
\r
public PluginRelease getCurrentRelease(Version system) {\r
PluginRelease current = null;\r
- if (!StringUtils.isEmpty(currentRelease)) {\r
- // find specified\r
- current = getRelease(currentRelease);\r
- }\r
-\r
- if (current != null) {\r
- // verify the current release is acceptable for this system\r
+ Date date = new Date(0);\r
+ for (PluginRelease pv : releases) {\r
Version requires = Version.ZERO;\r
- if (!StringUtils.isEmpty(current.requires)) {\r
- requires = Version.createVersion(current.requires);\r
- }\r
-\r
- if (!system.isZero() && !system.atLeast(requires)) {\r
- // requires newer system version\r
- current = null;\r
+ if (!StringUtils.isEmpty(pv.requires)) {\r
+ requires = Version.createVersion(pv.requires);\r
}\r
- }\r
\r
- if (current == null) {\r
- // find by date\r
- Date date = new Date(0);\r
- for (PluginRelease pv : releases) {\r
- Version requires = Version.ZERO;\r
- if (!StringUtils.isEmpty(pv.requires)) {\r
- requires = Version.createVersion(pv.requires);\r
- }\r
-\r
- if (system.isZero() || system.atLeast(requires)) {\r
- if (pv.date.after(date)) {\r
- current = pv;\r
- date = pv.date;\r
- }\r
+ if (system.isZero() || system.atLeast(requires)) {\r
+ if (pv.date.after(date)) {\r
+ current = pv;\r
+ date = pv.date;\r
}\r
}\r
}\r
return null;\r
}\r
\r
- public InstallState getInstallState() {\r
+ public InstallState getInstallState(Version system) {\r
if (StringUtils.isEmpty(installedRelease)) {\r
return InstallState.NOT_INSTALLED;\r
}\r
Version ir = Version.createVersion(installedRelease);\r
- Version cr = Version.createVersion(currentRelease);\r
+ Version cr = Version.ZERO;\r
+ PluginRelease curr = getCurrentRelease(system);\r
+ if (cr != null) {\r
+ cr = Version.createVersion(curr.version);\r
+ }\r
switch (ir.compareTo(cr)) {\r
case -1:\r
return InstallState.UNKNOWN;\r
state = Joiner.on(", ").join(InstallState.INSTALLED, pw.getPluginState());
} else {
// registered, installed plugin
- state = Joiner.on(", ").join(reg.getInstallState(), pw.getPluginState());
+ state = Joiner.on(", ").join(reg.getInstallState(system), pw.getPluginState());
}
StringBuilder sb = new StringBuilder();
curr = new PluginRelease();
}
if (verbose) {
- data[i] = new Object[] {p.id, p.description, p.installedRelease, curr.version, curr.requires, p.getInstallState(), p.registry};
+ data[i] = new Object[] {p.id, p.description, p.installedRelease, curr.version, curr.requires, p.getInstallState(system), p.registry};
} else {
- data[i] = new Object[] {p.id, p.installedRelease, curr.version, curr.requires, p.getInstallState()};
+ data[i] = new Object[] {p.id, p.installedRelease, curr.version, curr.requires, p.getInstallState(system)};
}
}
curr = new PluginRelease();
}
if (verbose) {
- outTabbed(p.id, p.description, p.installedRelease, curr.version, curr.requires, p.getInstallState(), p.provider, p.registry);
+ outTabbed(p.id, p.description, p.installedRelease, curr.version, curr.requires, p.getInstallState(system), p.provider, p.registry);
} else {
- outTabbed(p.id, p.installedRelease, curr.version, curr.requires, p.getInstallState());
+ outTabbed(p.id, p.installedRelease, curr.version, curr.requires, p.getInstallState(system));
}
}
}