Skip to content

Commit

Permalink
[FIXED JENKINS-9656] downgrade button shows 1.395 incorrectly
Browse files Browse the repository at this point in the history
  • Loading branch information
kohsuke committed May 12, 2011
1 parent 3e4aa73 commit d18f3ca
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 3 additions & 0 deletions changelog.html
Expand Up @@ -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>)
Expand Down
6 changes: 5 additions & 1 deletion core/src/main/java/hudson/model/UpdateCenter.java
Expand Up @@ -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;
Expand Down Expand Up @@ -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;}
Expand Down

0 comments on commit d18f3ca

Please sign in to comment.