[FIXED JENKINS-45235] When multiple update sites publish different versions, allow those versions to be seen

- When automatically installing dependent plugins, the first update center with a version meeting the minimum required will win
- Also enhances the CLI command to allow specification of a minimum version
This commit is contained in:
Stephen Connolly committed 2018-01-26 11:32:36 +00:00
1 parent 0d1f80ba9f
commit 884e95e0fa
7 files changed
+80 -18

No files matched your search

+3 -1
View File
@@ -641,7 +641,7 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
*/
public UpdateSite.Plugin getUpdateInfo() {
UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
UpdateSite.Plugin p = uc.getPlugin(getShortName());
UpdateSite.Plugin p = uc.getPlugin(getShortName(), getVersionNumber());
if(p!=null && p.isNewerThan(getVersion())) return p;
return null;
}
@@ -651,6 +651,8 @@ public class PluginWrapper implements Comparable<PluginWrapper>, ModelObject {
*/
public UpdateSite.Plugin getInfo() {
UpdateCenter uc = Jenkins.getInstance().getUpdateCenter();
UpdateSite.Plugin p = uc.getPlugin(getShortName(), getVersionNumber());
if (p != null) return p;
return uc.getPlugin(getShortName());
}