提交 bfaf4a42 编写于 作者: K kohsuke

added a switch to skip the "ln" invocation, even on Unix.

This is primarily added for the sake of Project Caroline, but I might remove this later.

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@11514 71c3de6d-444a-0410-be80-ed276b4c234a
上级 cbb13c1f
...@@ -37,7 +37,6 @@ import java.security.MessageDigest; ...@@ -37,7 +37,6 @@ import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException; import java.security.NoSuchAlgorithmException;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
...@@ -727,7 +726,7 @@ public class Util { ...@@ -727,7 +726,7 @@ public class Util {
* If there's a prior symlink at baseDir+symlinkPath, it will be overwritten. * If there's a prior symlink at baseDir+symlinkPath, it will be overwritten.
*/ */
public static void createSymlink(File baseDir, String targetPath, String symlinkPath, TaskListener listener) throws InterruptedException { public static void createSymlink(File baseDir, String targetPath, String symlinkPath, TaskListener listener) throws InterruptedException {
if(!isWindows()) { if(!isWindows() && !NO_SYMLINK) {
try { try {
// ignore a failure. // ignore a failure.
new LocalProc(new String[]{"rm","-rf", symlinkPath},new String[0],listener.getLogger(), baseDir).join(); new LocalProc(new String[]{"rm","-rf", symlinkPath},new String[0],listener.getLogger(), baseDir).join();
...@@ -805,4 +804,9 @@ public class Util { ...@@ -805,4 +804,9 @@ public class Util {
= FastDateFormat.getInstance("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US); = FastDateFormat.getInstance("EEE, dd MMM yyyy HH:mm:ss Z", Locale.US);
private static final Logger LOGGER = Logger.getLogger(Util.class.getName()); private static final Logger LOGGER = Logger.getLogger(Util.class.getName());
/**
* On Unix environment that cannot run "ln", set this to true.
*/
public static boolean NO_SYMLINK = Boolean.getBoolean(Util.class.getName()+".noSymLink");
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册