Skip to content
Permalink
Browse files
[FIXED JENKINS-9656] downgrade button shows 1.395 incorrectly
  • Loading branch information
kohsuke committed May 12, 2011
1 parent 3e4aa73 commit d18f3cadca8fe81b45df79be1ce7f6c3e3f62f6f
Showing with 8 additions and 1 deletion.
  1. +3 −0 changelog.html
  2. +5 −1 core/src/main/java/hudson/model/UpdateCenter.java
@@ -55,6 +55,9 @@
<!-- Record your changes in the trunk here. -->
<div id="trunk" style="display:none"><!--=TRUNK-BEGIN=-->
<ul class=image>
<li class=bug>
"Downgrade Jenkins" incorrectly shows 1.395
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9656">issue 9656</a>)
<li class=bug>
Fixed NPE in <tt>GlobalMatrixAuthorizationStrategy.doCheckName</tt>
(<a href="http://issues.jenkins-ci.org/browse/JENKINS-9412">issue 9412</a>)
@@ -72,6 +72,7 @@
import java.util.concurrent.Future;
import java.util.concurrent.ThreadFactory;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import java.util.logging.Level;
import java.util.logging.Logger;
@@ -339,7 +340,10 @@ public void doRestart(StaplerResponse rsp) throws IOException, ServletException
public String getBackupVersion() {
try {
JarFile backupWar = new JarFile(new File(Lifecycle.get().getHudsonWar() + ".bak"));
return backupWar.getManifest().getMainAttributes().getValue("Hudson-Version");
Attributes attrs = backupWar.getManifest().getMainAttributes();
String v = attrs.getValue("Jenkins-Version");
if (v==null) v = attrs.getValue("Hudson-Version");
return v;
} catch (IOException e) {
LOGGER.log(Level.WARNING, "Failed to read backup version ", e);
return null;}

0 comments on commit d18f3ca

Please sign in to comment.