提交 63a8adbe 编写于 作者: K kohsuke

ant throws an exception if the base dir doesn't exist.

This breaks some of the error checks in places like ArtifactArchiver or JavadocArchiver, so return 0 instead of IOException.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@14704 71c3de6d-444a-0410-be80-ed276b4c234a
上级 2fdcdc8c
......@@ -865,6 +865,7 @@ public final class FilePath implements Serializable {
// local to local copy.
return act(new FileCallable<Integer>() {
public Integer invoke(File base, VirtualChannel channel) throws IOException {
if(!base.exists()) return 0;
assert target.channel==null;
try {
......@@ -966,8 +967,13 @@ public final class FilePath implements Serializable {
TarOutputStream tar = new TarOutputStream(new GZIPOutputStream(new BufferedOutputStream(pipe.getOut())));
tar.setLongFileMode(TarOutputStream.LONGFILE_GNU);
DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project());
String[] files = ds.getIncludedFiles();
String[] files;
if(baseDir.exists()) {
DirectoryScanner ds = fs.getDirectoryScanner(new org.apache.tools.ant.Project());
files = ds.getIncludedFiles();
} else {
files = new String[0];
}
for( String f : files) {
if(Functions.isWindows())
f = f.replace('\\','/');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册