提交 cd6a71af 编写于 作者: M mindless

[FIXED HUDSON-4301] Creation of symlinks failed (or created in wrong location) since 1.320.


git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@21046 71c3de6d-444a-0410-be80-ed276b4c234a
上级 d7ae2279
......@@ -887,14 +887,15 @@ public class Util {
if(!isWindows() && !NO_SYMLINK) {
try {
// if a file or a directory exists here, delete it first.
if (new File(symlinkPath).exists())
File symlinkFile = new File(baseDir, symlinkPath);
if (symlinkFile.exists())
// ignore a failure.
new LocalProc(new String[]{"rm","-rf", symlinkPath},new String[0],listener.getLogger(), baseDir).join();
int r;
if (!SYMLINK_ESCAPEHATCH)
r = PosixAPI.get().symlink(targetPath,symlinkPath);
r = PosixAPI.get().symlink(targetPath,symlinkFile.getAbsolutePath());
else // escape hatch, until we know that the above works well.
r = new LocalProc(new String[]{
"ln","-s", targetPath, symlinkPath},
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册