git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@693846 13f79535-47bb-0310-9956-ffa450edef68master
@@ -101,6 +101,11 @@ Changes that could break older environments: | |||||
The task will now try to delete them in both cases. | The task will now try to delete them in both cases. | ||||
Bugzilla Report 41285. | Bugzilla Report 41285. | ||||
* if the dir attribute of a <fileset> point to a symbolic link and | |||||
followsymlinks is set to false, the fileset will no longer be | |||||
scanned and always seem empty. | |||||
Bugzilla Report 45741. | |||||
Fixed bugs: | Fixed bugs: | ||||
----------- | ----------- | ||||
@@ -786,6 +786,7 @@ public class DirectoryScanner | |||||
} | } | ||||
scanning = true; | scanning = true; | ||||
} | } | ||||
File savedBase = basedir; | |||||
try { | try { | ||||
synchronized (this) { | synchronized (this) { | ||||
illegal = null; | illegal = null; | ||||
@@ -797,6 +798,12 @@ public class DirectoryScanner | |||||
boolean nullExcludes = (excludes == null); | boolean nullExcludes = (excludes == null); | ||||
excludes = nullExcludes ? new String[0] : excludes; | excludes = nullExcludes ? new String[0] : excludes; | ||||
if (basedir != null && !followSymlinks | |||||
&& FILE_UTILS.isSymbolicLink(basedir.getParentFile(), | |||||
basedir.getName())) { | |||||
basedir = null; | |||||
} | |||||
if (basedir == null) { | if (basedir == null) { | ||||
// if no basedir and no includes, nothing to do: | // if no basedir and no includes, nothing to do: | ||||
if (nullIncludes) { | if (nullIncludes) { | ||||
@@ -839,7 +846,10 @@ public class DirectoryScanner | |||||
includes = nullIncludes ? null : includes; | includes = nullIncludes ? null : includes; | ||||
excludes = nullExcludes ? null : excludes; | excludes = nullExcludes ? null : excludes; | ||||
} | } | ||||
} catch (IOException ex) { | |||||
throw new BuildException(ex); | |||||
} finally { | } finally { | ||||
basedir = savedBase; | |||||
synchronized (scanLock) { | synchronized (scanLock) { | ||||
scanning = false; | scanning = false; | ||||
scanLock.notifyAll(); | scanLock.notifyAll(); | ||||
@@ -66,7 +66,7 @@ | |||||
<au:assertFileExists file="${output}/file.txt"/> | <au:assertFileExists file="${output}/file.txt"/> | ||||
</target> | </target> | ||||
<target name="FAILStestBasedirIsSymlinkNoFollow" | |||||
<target name="testBasedirIsSymlinkNoFollow" | |||||
depends="checkOs, setUp, -basedir-as-symlink" | depends="checkOs, setUp, -basedir-as-symlink" | ||||
if="unix"> | if="unix"> | ||||
<copy todir="${output}"> | <copy todir="${output}"> | ||||
@@ -137,7 +137,7 @@ | |||||
<fileset dir="${base}" followsymlinks="false"/> | <fileset dir="${base}" followsymlinks="false"/> | ||||
</copy> | </copy> | ||||
<symlink action="delete" link="${base}"/> | <symlink action="delete" link="${base}"/> | ||||
<assertDirIsEmpty/> | |||||
<au:assertFileDoesntExist file="${output}"/> | |||||
</target> | </target> | ||||
<target name="-sibling" if="unix"> | <target name="-sibling" if="unix"> | ||||