diff --git a/changelog.html b/changelog.html
index aa083a33ff..3303a2e77d 100644
--- a/changelog.html
+++ b/changelog.html
@@ -64,6 +64,9 @@ Upcoming changes
Fixed ConcurrentModificationException in parallel Maven 3 builds.
(issue 11256)
+
+ Copy artifacts fails on windows slaves due to failing to set a timestamp.
+ (issue 11073)
CLI jar now has the version number in the manifest as well as the "-version" option.
@@ -95,9 +98,6 @@ Upcoming changes
Dependency wasn't recalculated with CLI "update-job" command.
(issue 11636)
-
- Copy artifacts fails on windows slaves due to failing to set a timestamp.
- (issue 11073)
Sortable table wasn't "stable" when there are same values in different rows
(issue 11551)
diff --git a/core/src/main/java/hudson/FilePath.java b/core/src/main/java/hudson/FilePath.java
index 3a8f236db5..73646db2a2 100644
--- a/core/src/main/java/hudson/FilePath.java
+++ b/core/src/main/java/hudson/FilePath.java
@@ -291,7 +291,7 @@ public final class FilePath implements Serializable {
/**
* Checks if the remote path is Unix.
*/
- private boolean isUnix() {
+ boolean isUnix() {
// if the path represents a local path, there' no need to guess.
if(!isRemote())
return File.pathSeparatorChar!=';';
@@ -1429,7 +1429,7 @@ public final class FilePath implements Serializable {
target.touch(lastModified());
} catch (IOException e) {
// On Windows this seems to fail often. See JENKINS-11073
- if (!isUnix()) {
+ if (!target.isUnix()) {
LOGGER.warning("Failed to set timestamp on " + target.getRemote());
} else { // rethrow
throw new IOException2(e);
diff --git a/core/src/test/java/hudson/FilePathTest.java b/core/src/test/java/hudson/FilePathTest.java
index c91ce89978..dd385d8c92 100644
--- a/core/src/test/java/hudson/FilePathTest.java
+++ b/core/src/test/java/hudson/FilePathTest.java
@@ -23,6 +23,7 @@
*/
package hudson;
+import hudson.remoting.LocalChannel;
import hudson.remoting.VirtualChannel;
import hudson.util.IOException2;
import hudson.util.NullStream;
@@ -296,5 +297,23 @@ public class FilePathTest extends ChannelTestCase {
Util.deleteRecursive(baseDir);
}
}
+
+ @Bug(11073)
+ public void testIsUnix() {
+ FilePath winPath = new FilePath(new LocalChannel(null),
+ " c:\\app\\hudson\\workspace\\3.8-jelly-db\\jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver\\acceptance-tests\\distribution.zip");
+ assertFalse(winPath.isUnix());
+
+ FilePath base = new FilePath(new LocalChannel(null),
+ "c:\\app\\hudson\\workspace\\3.8-jelly-db");
+ FilePath middle = new FilePath(base, "jdk/jdk1.6.0_21/label/sqlserver/profile/sqlserver");
+ FilePath full = new FilePath(middle, "acceptance-tests\\distribution.zip");
+ assertFalse(full.isUnix());
+
+
+ FilePath unixPath = new FilePath(new LocalChannel(null),
+ "/home/test");
+ assertTrue(unixPath.isUnix());
+ }
}