On 2018-06-06, Gintautas Grigelionis wrote:

> 2018-06-06 10:50 GMT+02:00 Stefan Bodewig <bode...@apache.org>:

>> On 2018-06-05, Gintautas Grigelionis wrote:

>>> Stefan is right -- "followsymlinks" for the fileset should have been
>> called
>>> "skipsymlinks" or something like that.

>> I'm afraid I don't follow you here, what did you expect followsymlinks
>> going by the name? What would the "new semantics of followsymlinks" you
>> talk about be?

>> How would the combinations

>> followsymlinks="true" skipsymlinks="true"
>> followsymlinks="false" skipsymlinks="false"

>> behave?

> I expect the following:
> followsymlinks="false" should select symbolic links (rather than omitting
> them which seems to be its current behaviour);
> followsymlinks="true" should select whatever the links point at to (unless
> there is a loop).

I guess here our API breaks down as we only ever deal with files or
directories (outside of the symlink task).

Would the symlink be included in DirectoryScanner's "included files" or
"included directories"? What will <copy> do to a symlink that is
included but not followed.

The current semantics of fileset's followsymlinks is deeply rooted in
"we don't know how to deal with links and can only handle files and
directories". I'm afraid a bunch of tasks will not do what you expect if
DirectoryScanner suddenly returned File instances that are not real
files/directories. Either they'd simply follow the link or break down -
I assume in most cases it will be the former.

> Consequently, I expect
> followsymlinks="false" skipsymlinks="false" to behave as
> followsymlinks="false";

which would be the same as skipsymlinks="true", right?

> whereas followsymlinks="true" skipsymlinks="true" is ambiguous: if
> followsymlinks takes precedence, skipsymlinks is redundant; if
> skipsymlinks takes precedence, then followsymlinks is ignored.

So we'd need to decide what takes precedence and document it properly.

As I said above, I don't think Ant's tasks are going to treat
non-followed symlinks the way you'd expect them to. We could collect
them separately and add a new getIncludedSymlinks method to
DirectoryScanner so each task could do what it is supposed to do for
not-followed links, but then we'll start documenting whether a given
task X handles those links at all and if so what it does.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to