mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-04 07:35:53 +00:00
[Fixed JENKINS-13129] Updating built-in plugins doesn't work, the file doesn't get pinned and is overwritten on the next startup
changed bundled plugin detection, added unit test
This commit is contained in:
1 parent
5454d17c33
commit
2453985ca5
2 files changed
+74
-1
No files matched your search
@@ -196,7 +196,7 @@ public abstract class PluginManager extends AbstractModelObject {
|
||||
PluginWrapper p = strategy.createPluginWrapper(arc);
|
||||
if (isDuplicate(p)) return;
|
||||
|
||||
p.isBundled = bundledPlugins.contains(arc.getName());
|
||||
p.isBundled = containsHpiJpi(bundledPlugins, arc.getName());
|
||||
plugins.add(p);
|
||||
} catch (IOException e) {
|
||||
failedPlugins.add(new FailedPlugin(arc.getName(),e));
|
||||
@@ -344,6 +344,15 @@ public abstract class PluginManager extends AbstractModelObject {
|
||||
}});
|
||||
}
|
||||
|
||||
/*
|
||||
* contains operation that considers xxx.hpi and xxx.jpi as equal
|
||||
* this is necessary since the bundled plugins are still called *.hpi
|
||||
*/
|
||||
private boolean containsHpiJpi(Collection<String> bundledPlugins, String name) {
|
||||
return bundledPlugins.contains(name.replaceAll("\\.hpi",".jpi"))
|
||||
|| bundledPlugins.contains(name.replaceAll("\\.jpi",".hpi"));
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO: revisit where/how to expose this. This is an experiment.
|
||||
*/
|
||||
|
||||
Reference in new issue
Block a user