Skip to content

[Filesystem] Mirror should keep the original symlink target #9866

@COil

Description

@COil

The mirror function should keep the original symlink target and not the real path.
When having a link that is already in a linked directory, the mirror function set the mirrored link with the realpath and not the original target directory of the symlink.

To reproduce:

I am in a project, the webapp directory in /var/www is an alias:

[14:01:30] COil@COil:/var/www/myproject$ ll
total 12K
4,0K drwxr-xr-x 3 COil COil 4,0K oct.  10 11:03 .
4,0K drwxr-xr-x 9 COil COil 4,0K déc.  26 13:50 ..
   0 lrwxrwxrwx 1 COil COil   38 juil. 10 11:40 webapp -> /home/workspace/myproject/frontend/

The /var/www/myproject/webapp/apps/symfony2 directory contains a symfony2 application, a command
mirrors the /var/www/myproject/webapp/apps/template dir to /var/www/myproject/webapp/apps/newapp.

In this new directory /var/www/myproject/webapp/apps/newapp there are symlinks:

fcBehatPlugin -> /home/workspace/myproject/frontend/apps/template/plugins/fcBehatPlugin

As you can see the symlink is incorrect as it should be the same (relative) it was in the initial template directory that was mirrored.

Same task with the patch applied, we have:

fcBehatPlugin -> ../../../vendor/server/Mycompany/fcBehatPlugin

PR #9867

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions