mirror of
https://github.com/jenkinsci/jenkins.git
synced 2026-11-08 01:26:03 +00:00
[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
This commit is contained in:
1 parent
d7ae2279ad
commit
cd6a71af00
1 file changed
+3
-2
@@ -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},
|
||||
|
||||
Reference in new issue
Block a user