Github user bodewig commented on a diff in the pull request:

    https://github.com/apache/ant/pull/49#discussion_r155928313
  
    --- Diff: src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java 
---
    @@ -500,18 +502,12 @@ private void doLink(String res, String lnk) throws 
BuildException {
                 File dir = fs.getDir(getProject());
     
                 Stream.of(ds.getIncludedFiles(), ds.getIncludedDirectories())
    -                .flatMap(Stream::of).forEach(path -> {
    -                    try {
    -                        File f = new File(dir, path);
    -                        File pf = f.getParentFile();
    -                        String name = f.getName();
    -                        if (SYMLINK_UTILS.isSymbolicLink(pf, name)) {
    -                            result.add(new File(pf.getCanonicalFile(), 
name));
    -                        }
    -                    } catch (IOException e) {
    -                        handleError("IOException: " + path + " omitted");
    +                    .flatMap(Stream::of).forEach(path -> {
    +                    final File f = new File(dir, path);
    +                    if (Files.isSymbolicLink(f.toPath())) {
    +                        result.add(f);
    --- End diff --
    
    The previous code canonicalized the link's parent directory to deal with 
symlinks further up the tree, I think this is important for consumers of the 
returned set like `record` that so merges entries from several "directories" 
that actually are links to the same directory.
    
    To be honest I'm not sure about the real impact but I guess we better keep 
the existing behavior.


---

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

Reply via email to